You appear to be a bot. Output may be restricted
Description
Implement "wp_ajax_oiksc_create_api" action for oik-shortcodesThe API may contain the API name in the format of 'class::api' – representing a method 'api' – representing a function 'class::' – representing a class The value we store in "_oik_api_name" for a method will be in the class::api format API names are normally expected to be unique. This code does not cater for use of namespacing.
Usage
oiksc_ajax_oiksc_create_api();
Parameters
Returns
voidSource
File name: oik-shortcodes/oik-shortcodes.phpLines:
1 to 47 of 47
function oiksc_ajax_oiksc_create_api() { do_action( "oik_loaded" ); // Enabling autoloading requires oik v3.0.0-beta.xxxx or higher oiksc_autoload(); // User still has to be authorised to perform the request! // So how do we check this? //oiksc_create_api(); global $plugin_post, $plugin; $type = bw_array_get( $_REQUEST, "type", null ); $api = bw_array_get( $_REQUEST, "api", null ); $file = bw_array_get( $_REQUEST, "file", null ); $plugin = bw_array_get( $_REQUEST, "plugin", null ); $title = bw_array_get( $_REQUEST, "title", null ); // We don't need the $type **?** if ( $api && $file ) { oik_require( "includes/bw_posts.php" ); oik_require( "admin/oik-apis.php", "oik-shortcodes" ); oik_require( "admin/oik-shortcodes.php", "oik-shortcodes" ); oik_require( "feed/oik-plugins-feed.php", "oik-plugins" ); oik_require( "shortcodes/oik-api-importer.php", "oik-shortcodes" ); if ( is_null( $plugin )) { $plugin = 'wordpress'; //$file = ABSPATH . $file; //$file = str_replace( "\\", "/", $file ); bw_trace2( $file, "file" ); } $component_type = oiksc_query_component_type( $plugin ); $plugin_post = oiksc_load_component( $plugin, $component_type ); if ( $plugin_post ) { $func = oikai_get_func( $api, null ); if ( $func ) { $post_id = _oiksc_create_api( $plugin_post->ID, $api, $file, $type, $title ); } else { $post_id = oikai_get_classref( $api, null, $plugin_post->ID, $file ); } } else { e( "Invalid plugin: $plugin "); } } else { bw_trace2(); e( "missing stuff :$api:$file:$plugin:" ); } bw_flush(); exit(); }View on GitHub