bobbingwide / oik-a2z

Letter taxonomy pagination
http://www.oik-plugins.com/oik-plugins/oik-a2z-letter-taxonomy-pagination/
GNU General Public License v3.0
0 stars 0 forks source link

Add support for setting terms in batch #7

Open bobbingwide opened 7 years ago

bobbingwide commented 7 years ago

The logic to create letter taxonomy terms should work when the code is being run in batch. This is needed when parsing the source code in oik-shortcodes for WP-a2z.org and oik-plugins.

Expected output

Letter taxonomy terms set for posts created or updated in oik-batch

Actual output

Letter taxonomy terms were not being set.

Explanation

The lazy logic was not being loaded since $_REQUEST['tax_input'] was not set.

Solution

Check for Command Line Interface. In the lazy loaded code cater for $_REQUEST['tax_input'] not being set.

bobbingwide commented 7 years ago

It appears that the check for command line interface works better if you call php_sapi_name() rather than test the value of the PHP_SAPI constant. See bobbingwide/oik-batch/issues/19