[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_oik_shortcodes() – Register custom post type "oik_shortcodes"

You appear to be a bot. Output may be restricted

Description

Register custom post type "oik_shortcodes"

The title should contain the shortcode name In the content the text before the <!–more –> should be the shortcode's short description The rest of the content should show the syntax, examples, links to APIs etc Some of this is autogenerated using shortcodes.

  • Post type support of "publicize" enables publicizing using JetPack.
  • Post type support of 'author' enables support for oik-user
  • Post type support of 'revisions' allows for mistakes

Usage

oik_register_oik_shortcodes();

Parameters

Returns

void

TO DO

is query_var required

Source

File name: oik-shortcodes/oik-shortcodes.php
Lines:
1 to 50 of 50
function oik_register_oik_shortcodes() {
  $post_type = 'oik_shortcodes';
  $post_type_args = array();
  $post_type_args['label'] = 'Shortcodes';
  $post_type_args['description'] = 'Shortcode definitions';
  $post_type_args['has_archive'] = true;
  $post_type_args['supports'] = array( 'title', 'editor', 'revisions', 'author', 'publicize', 'clone', 'author' );
  // Not using query_var for this post type
  // $post_type_args['query_var'] = "oik-shortcodes";
  $post_type_args['show_in_rest'] = true;
  $post_type_args['show_in_nav_menus'] = false;
  bw_register_post_type( $post_type, $post_type_args );
  //add_post_type_support( $post_type, 'publicize' );
  //add_post_type_support( $post_type, 'author' );
  //add_post_type_support( $post_type, 'revisions' );
  
  
  bw_register_field( "_oik_sc_code", "text", "Shortcode" ); 
  bw_register_field( "_oik_sc_plugin", "noderef", "Plugin ref", array( "#type" => array( "oik-plugins", "oik-themes" ) ) ); 
  //bw_register_field( "_oik_sc_func", "noderef", "API ref", array( "#type" => "oik_api", "#theme" => false, '#form' => false )); 
  bw_register_field( "_oik_sc_func", "sctext", "API ref", array( "#type" => "oik_api",  "#theme" => true, '#theme_null' => false ) );
  bw_register_field( "_oik_sc_example_cb", "checkbox", "Generate the programmed example?", array( "#theme" => false ) ); 
  bw_register_field( "_oik_sc_live_cb", "checkbox", "Generate examples using Live data?", array( "#theme" => false ) );
  bw_register_field( "_oik_sc_snippet_cb", "checkbox", "Generate snippets?", array( "#theme" => false ) ); 
  bw_register_field( "_oik_sc_endcode_cb", "checkbox", "Enclosed content shortcode? Needs [<i>/code</i>]?" );
  
  $the_title_args = array( "#callback" => "bw_get_shortcode_expands_in_titles"
                         , "#parms" => "_oik_sc_code" 
                         , "#plugin" => "oik"
                         , "#file" => "shortcodes/oik-codes.php"
                         , "#form" => false
                         , "#hint" => "virtual field"
                         ); 
  bw_register_field( "_oik_sc_the_title_cb", "virtual", "Expands in 'the_title'?", $the_title_args );
  //bw_register_field( "_oik_sc_shortcake_cb", "checkbox", "Compatible with shortcake?" );
  
  bw_register_field_for_object_type( "_oik_sc_code", $post_type );
  bw_register_field_for_object_type( "_oik_sc_plugin", $post_type );
  bw_register_field_for_object_type( "_component_version", $post_type );
  bw_register_field_for_object_type( "_oik_sc_func", $post_type );
  bw_register_field_for_object_type( "_oik_sc_example_cb", $post_type );
  bw_register_field_for_object_type( "_oik_sc_live_cb", $post_type );
  bw_register_field_for_object_type( "_oik_sc_snippet_cb", $post_type );
  bw_register_field_for_object_type( "_oik_sc_endcode_cb", $post_type );
  bw_register_field_for_object_type( "_oik_sc_the_title_cb", $post_type );
  //bw_register_field_for_object_type( "_oik_sc_shortcake_cb", $post_type );
  
  add_filter( "manage_edit-${post_type}_columns", "oik_shortcodes_columns", 10, 2 );
  add_action( "manage_${post_type}_posts_custom_column", "bw_custom_column_admin", 10, 2 );
}
 
 View on GitHub

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

Information

Function name: oik_register_oik_shortcodes
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,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