You appear to be a bot. Output may be restricted
Description
Create or update an "oik_api" post_type
Usage
$ID = _oiksc_create_api( $plugin, $api, $file, $type, $title, $echo );
Parameters
- $plugin
- ( ID ) required –
- $api
- ( string ) required –
- $file
- ( string ) required –
- $type
- ( string ) required –
- $title
- ( string ) optional –
- $echo
- ( bool ) optional default: 1 – true for the front end, false in batch
Returns
IDSource
File name: oik-shortcodes/admin/oik-apis.phpLines:
1 to 42 of 42
function _oiksc_create_api( $plugin, $api, $file, $type, $title=null, $echo=true ) { p( "Creating API: $api file: $file" ); oik_require( "shortcodes/oik-apilink.php", "oik-shortcodes" ); $post_ids = oikai_get_oik_api_byname( $api ); bw_trace2( $post_ids, "post_ids", BW_TRACE_DEBUG ); if ( !$post_ids || 0 === count( $post_ids) ) { $post_id = oiksc_create_oik_api( $plugin, $api, $file, $type, $title ); } else { $post = get_post( $post_ids[0] ); if ( $post ) { $post_id = $post->ID; oiksc_update_oik_api( $post, $plugin, $api, $file, $type, $title ); } else { p( "Error: post missing for " . $post_ids[0]); } } oikai_load_posts( $api ); global $oikai_post_id; $oikai_post_id = $post_id; /** * We need to ensure that the first instance of the function name does not appear as a call to the function. * To achieve this we need to let the pseudo method know that it's part of the class. */ $class = oikai_get_class( $api ); p( "Class $class" ); bw_context( "classname", $class ); //bw_context( "variable", "this" ); //bw_context( "operator", "function" ); bw_context( "paged", false ); oiksc_build_callees( $api, $file, $plugin, $post_id, $echo ); if ( $echo ) { oikai_save_callees( $post_id ); oiksc_save_hooks( $post_id ); oiksc_save_associations( $post_id ); } return( $post_id ); }View on GitHub