Description
Create or update an "oik_file" post_type
Usage
$ID = _oikai_create_file( $plugin, $file );Parameters
- $plugin
- ( ID ) required –
- $file
- ( string ) required –
Returns
IDSource
File name: oik-shortcodes/admin/oik-files.phpLines:
1 to 34 of 34
function _oikai_create_file( $plugin, $file ) { p( "Creating file: $file" ); bw_flush(); $post = oiksc_get_oik_file_byname( $plugin, $file ); $parent = oiksc_create_ancestry( $post, $plugin, $file ); bw_trace2( $post, "post", true, BW_TRACE_DEBUG ); if ( !$post ) { $post_id = oiksc_create_oik_file( $plugin, $file, $parent ); } else { $post_id = $post->ID; $post->post_parent = $parent; oiksc_update_oik_file( $post, $plugin, $file ); } 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" ); //oiksc_build_callees( null, $file, $plugin ); // oikai_save_callees( $post_id ); // oiksc_save_hooks( $post_id ); // oiksc_save_associations( $post_id ); return( $post_id ); }View on GitHub
Called by
1 to 3 of 3
Invoked by
Calls
1 to 7 of 7
- bw_flush() – Use bw_flush() to echo the contents of $bwecho then empty it
- bw_trace2() – Trace $value to the trace log file if tracing is active
- oiksc_create_ancestry() – Determine the post_parent for an oik_file
- oiksc_create_oik_file() – Programmatically create an oik_file record for a selected plugin’s file
- oiksc_get_oik_file_byname() – Return the "oik_file" post for the given plugin ID and file name
- oiksc_update_oik_file() – Update an "oik_file" post type
- p() – Output a paragraph of translatable text
