You appear to be a bot. Output may be restricted
Description
Function to invoke when createapi2.php is loadedSyntax: $argv[0] –plugin= [–site= –user= –pass= –apikey=] –name=api –previous=previous –start=start Note: createapi2.php is not designed to be called by oik-batch.php as it needs to obtain parameters using oikb_getopt()
Usage
createapis_loaded( $argc, $argv );
Parameters
- $argc
- ( mixed ) required –
- $argv
- ( mixed ) required –
Returns
voidTO DO
remove this limitation Include files are selected from wp-settings.php Quite a few were added in WordPress 4.4.xSource
File name: oik-batch/createapi2.phpLines:
1 to 77 of 77
function createapis_loaded( $argc, $argv ) { echo "In createapis_loaded" . PHP_EOL ; if ( !function_exists( "oik_batch_run_script" ) ) { require_once( "oik-batch.php" ); } if ( defined( 'WP_SETUP_CONFIG' ) ) { if ( true == 'WP_SETUP_CONFIG' ) { bw_trace2( "WP_SETUP_CONFIG is already defined as true" ); } else { bw_trace2( "WP_SETUP_CONFIG is already defined as false" ); } } else { define( 'WP_SETUP_CONFIG', true ); // Do we need these now? require_once( ABSPATH . WPINC . "/http.php" ); require( ABSPATH . WPINC . '/class-http.php' ); // Some, or all of these are needed for WordPress 4.4.x require( ABSPATH . WPINC . '/class-wp-http-streams.php' ); require( ABSPATH . WPINC . '/class-wp-http-curl.php' ); require( ABSPATH . WPINC . '/class-wp-http-proxy.php' ); require( ABSPATH . WPINC . '/class-wp-http-cookie.php' ); require( ABSPATH . WPINC . '/class-wp-http-encoding.php' ); require( ABSPATH . WPINC . '/class-wp-http-response.php' ); require_once( ABSPATH . "wp-admin/includes/plugin.php" ); require_once( ABSPATH . WPINC . "/shortcodes.php" ); require_once( ABSPATH . WPINC . "/theme.php" ); oik_require( "/libs/bobbfunc.php" ); oik_require( "bobbcomp.inc" ); oik_require( "oik-login.inc", "oik-batch" ); $plugin = bw_array_get( oikb_getopt(), "plugin", null ); echo "Plugin/theme: $plugin" . PHP_EOL; global $apikey; $apikey = bw_array_get( oikb_getopt(), "apikey", null ); echo "apikey: $apikey" . PHP_EOL; global $selected_api; $selected_api = bw_array_get( oikb_getopt(), "name", null ); echo "api: $selected_api!" . PHP_EOL; /** * We can only use previous= when we've chosen a specific plugin */ $previous = bw_array_get( oikb_getopt(), "previous", null ); echo "Previous: $previous" . PHP_EOL; /** * Use start to restart the processing from a particular point * Again, only really relevant for a single plugin */ $start = bw_array_get( oikb_getopt(), "start", 1 ); echo "Start: $start" . PHP_EOL; if ( $plugin ) { $component = $plugin; // $argv[1]; } else { oik_require( "list_oik_plugins.php", "oik-batch" ); $component = list_oik_plugins(); } oik_require( "admin/oik-apis.php", "oik-shortcodes" ); oik_require( "oik-ignore-list.php", "oik-batch" ); $components = bw_as_array( $component ); foreach ( $components as $component ) { _ca_doaplugin( $component, $previous, $start ); } //echo "done" . PHP_EOL; } }View on GitHub