[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_API() – Register custom post type: oik_api

You appear to be a bot. Output may be restricted

Description

Register custom post type: oik_api

Metadata fields:

  • Do not include syntax since this is determined programmatically
  • It should be possible to augment the documentation for an API if we know the particular type
  • It should not be necessary to document the number of parameters needed for an action or filter since
  • this should be obvious from the prototype
  • BUT someone might want to specify the expected priority in the body
  • _oik_api_hooks is a serialized structure that is not exposed to the end user. Herb 2013/10/23
  • 2014/07/08 We no longer register _oik_api_example or _oik_api_notes – if required these should be created as separate post types
  • oik_api_source has become redundant

Usage

oik_register_API();

Parameters

Returns

void

Source

File name: oik-shortcodes/oik-shortcodes.php
Lines:
1 to 40 of 40
function oik_register_API() {
  $post_type = 'oik_api';
  $post_type_args = array();
  $post_type_args['label'] = 'APIs';
  $post_type_args['description'] = 'Application Programming Interfaces';
  $post_type_args['supports'] = array( 'title', 'editor', 'revisions', 'author' );
  $post_type_args['has_archive'] = true;
  $post_type_args['show_in_rest'] = true;
  bw_register_post_type( $post_type, $post_type_args );
  
  bw_register_field( "_oik_api_name", "text", "Function name" , array( "#length" => 80 ));
  bw_register_field( "_oik_api_class", "noderef", "Class ref", array( "#type" => "oik_class", "#optional" => true, '#theme_null' => false )); 
  bw_register_field( "_oik_api_plugin", "noderef", "Plugin ref", array( "#type" => array( "oik-plugins", "oik-themes" ) )); 
  bw_register_field( "_oik_api_source", "text", "Sourcefile" , array( "#length" => 80 ));
  bw_register_field( "_oik_fileref", "noderef", "File ref", array( "#type" => "oik_file" )); 
  bw_register_field( "_oik_api_type", "select", "API type", array( "#options" => oiksc_api_types(), "#optional" => true, '#theme_null' => false ) );
  //bw_register_field( "_oik_api_example", "textarea", "Examples", array( '#theme' => false, '#form' => false ) ); 
  //bw_register_field( "_oik_api_notes", "textarea", "Notes", array( '#theme' => false, '#form' => false ) ); 
  bw_register_field( "_oik_api_deprecated_cb", "checkbox", "Deprecated?" ); 
  
  //bw_register_field( "_oik_api_calls", "noderef", "Uses APIs", array( "#type" => "oik_api", "#multiple" => true, "#optional" => true, '#theme' => false ));
  //bw_register_field( "_oik_api_hooks", "noderef", "Uses hooks", array( "#type" => "oik_hook", "#multiple" => true, "#optional" => true, '#theme' => false ));
  
  bw_register_field_for_object_type( "_oik_api_name", $post_type );
  bw_register_field_for_object_type( "_oik_api_class", $post_type );
  bw_register_field_for_object_type( "_oik_api_plugin", $post_type );
  bw_register_field_for_object_type( "_component_version", $post_type );
  bw_register_field_for_object_type( "_oik_api_source", $post_type );
  bw_register_field_for_object_type( "_oik_fileref", $post_type );
  bw_register_field_for_object_type( "_oik_api_type", $post_type );
  //bw_register_field_for_object_type( "_oik_api_example", $post_type );
  //bw_register_field_for_object_type( "_oik_api_notes", $post_type );
  bw_register_field_for_object_type( "_oik_api_deprecated_cb", $post_type );
  bw_register_field_for_object_type( "_oik_api_calls", $post_type );
  bw_register_field_for_object_type( "_oik_api_hooks", $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_API
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: A,O,R

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