[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

oik_register_parsed_source() – Register Custom Post Type: oik_parsed_source

You appear to be a bot. Output may be restricted

Description

Register Custom Post Type: oik_parsed_source

The 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:

  1. Updated plugin producing new logic – here we just force the parsing
  2. Some other component has now been parsed – which may affect the links we create to "APIs", "WordPress a2z", PHP
  3. Change to the source PHP
title: "Parsed $post_title of the referenced object post_content: the parsed content post_content_filtered: Not a good idea to use this field as WordPress cleans it out regularly post_excerpt: might be an idea? last_update_date: date when last parsed? – we probably can't trust this

Usage

oik_register_parsed_source();

Parameters

Returns

void

Source

File name: oik-shortcodes/oik-shortcodes.php
Lines:
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

Published: March 11, 2017 | Last updated: March 11, 2017

Information

Function name: oik_register_parsed_source
Plugin ref: oik block shortcode and API server
Version: 1.41.1
Sourcefile: oik-shortcodes.php
File ref: oik-shortcodes.php
Deprecated?: No
API Letters: O,P,R,S

Recent plugin updates

oik v4.7.2 oik v4.7.2 includes a fix to the logic to render blocks for Content and Excerpts in the bw_pages shortcode. ...
oik v4.7.1 Upgrade to oik v4.7.1 for bw_pages rendering blocks for Content and Excerpts, and support for post_name attribute for shortcode which query posts ...
oik-shortcodes v1.41.1 Upgrade to oik-shortcodes v1.41.1 for a couple of minor changes. ...
oik-bob-bing-wide v2.2.2 Upgrade to oik-bob-bing-wide v2.2.2 for improvements to bw_dash examples and fixes to some SVG icon's visibility. ...
oik-bwtrace v3.3.1 Upgrade to oik-bwtrace v3.3.1 to measure plugin load times and ad hoc action timing points. ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: [email protected]

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2022. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.0.1. PHP: 7.4.30. Memory limit: 768M