You appear to be a bot. Output may be restricted
Description
Register Custom Post Type: oik_parsed_sourceThe parsed source CPT contains the parsed source for an API, file or class Whenever the [bw_api] shortcode is expanded to display the parsed source we look for a parsed source version and use that in preference to dynamically parsing the source. Logic will exist to check if the parsed source is the latest If it's not then the source will be reparsed and the call trees and hook invocations rebuilt. We therefore need to store private information about the API, file and class that we've parse in order to be able to determine whether or not to re-parse the code. Reasons for reparsing the code are:
- Updated plugin producing new logic – here we just force the parsing
- Some other component has now been parsed – which may affect the links we create to "APIs", "WordPress a2z", PHP
- Change to the source PHP
Usage
oik_register_parsed_source();
Parameters
Returns
voidSource
File name: oik-shortcodes/oik-shortcodes.phpLines:
1 to 22 of 22
function oik_register_parsed_source() { $post_type = 'oik_parsed_source'; $post_type_args = array(); $post_type_args['label'] = 'Parsed Source'; $post_type_args['description'] = 'Pre-parsed APIs, files and classes'; $post_type_args['exclude_from_search'] = true; $post_type_args['show_in_nav_menus'] = false; $post_type_args['has_archive'] = false; bw_register_post_type( $post_type, $post_type_args ); bw_register_field( "_oik_sourceref", "noderef", "Source ref", array( "#type" => array( "oik_api", "oik_file", "oik_class" ) ) ); bw_register_field( "_oik_parse_count", "timestamp", "Parse count / Source file date" ); bw_register_field( "_oik_md5_hash", "text", "MD5 hash" ); bw_register_field_for_object_type( "_oik_sourceref", $post_type ); bw_register_field_for_object_type( "_oik_parse_count", $post_type ); bw_register_field_for_object_type( "_oik_md5_hash", $post_type ); if ( function_exists( "oikp_columns_and_titles" ) ) { oikp_columns_and_titles( $post_type ); } }View on GitHub