[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

Example: demonstrating the [bw_api] shortcode

Use the [bw_api] shortcode, from the oik-shortcodes plugin, to create dynamic API documentation of your plugin(s) or theme(s) code. When combined with the end tag, you can create highlighted syntax with dynamically generated links to the called functions for any valid PHP code.

You appear to be a bot. Output may be restricted


$id = bw_array_get( $atts, "id", null );
if ( is_numeric( $id ) ) {
  $post = get_post( $id );
} else {
  $post = get_posts( array( "name" => $id ) );
}
 
Click on the links to see more information about the APIs:
  • bw_array_get() – Return the array[index] or array->index (for an object) or a default value if not set
  • is_numeric() PHP API
  • get_post() and get_posts() WordPress APIs
Note: If you don’t use the end tag for the shortcode then it will use the parameters to determine what to display.

See also

[bw_api] oik-plugins oik-shortcodes

hover to slideToggle source

Use the [bw_code bw_api] shortcode, from the [bw_plug name="oik-shortcodes"] plugin, to create dynamic API documentation of your plugin(s) or theme(s) code.<!--more-->When combined with the end tag, you can create highlighted syntax with dynamically generated links to the called functions for any valid PHP code.[bw_api ]$id = bw_array_get( $atts, "id", null );if ( is_numeric( $id ) ) { $post = get_post( $id );} else { $post = get_posts( array( "name" => $id ) );}[/bw_api]Click on the links to see more information about the APIs:[apis bw_array_get]<ul><li><a href="http://www.php.net/manual/en/function.is-numeric.php" title="is_numeric">is_numeric() PHP API</a></li><li><a href="http://phpdoc.wordpress.org/trunk/WordPress/Post/_wp-includes---post.php.html#functionget_post">get_post() and get_posts() WordPress APIs</a></li></ul><strong>Note:</strong> If you don't use the end tag for the shortcode then it will use the parameters to determine what to display.<h3>See also</h3>[bw_code bw_api][bw_plug name="oik-plugins"][bw_plug name="oik-shortcodes"][clear]<hr />[bw_wtf]

Published: July 12, 2013 | Last updated: April 4, 2014

Information

Shortcode: bw_api – Dynamic API syntax help
Letters:

Syntax

Syntax

[bw_api
funcname="| function - Name of the function"
sourcefile="| sourcefile - Sourcefile containing the function"
plugin="| plugin - Implementing plugin slug"]

Other examples

    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: oikplug@oik-plugins.com

    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-2023. All rights reserved.


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