[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

bw_plug() – Implement [bw_plug] shortcode

Description

Implements the [bw_plug] shortcode

Notes:

  • When the table parameter is set to true then the data is formatted in a table.
  • A table header and footer is added.
Instead of coding: [bw_plug name='oik' table='y'][bw_plug name='wordpress-google-plus-one-button' table='y'] simplify it to [bw_plug name='oik,wordpress-google-plus-one-button' table='y'] In fact – you can omit the table= parameter since it's forced when there's more than one name.

Usage

$string = bw_plug( $atts, $content, $tag );

Parameters

$atts
( array ) optional – shortcode parameters
$content
( string ) optional – not expected
$tag
( string ) optional – not expected

Returns

string generated HTML for the shortcode link or table of shortcodes

Source

File name: oik-bob-bing-wide/shortcodes/oik-plug.php
Lines:
1 to 58 of 58
function bw_plug( $atts=null, $content=null, $tag=null ) {
  $name = bw_array_get_from( $atts, 'name,0', 'oik' );
  $link = bw_array_get( $atts, 'link', 'n' );
  $table = bw_array_get( $atts, 'table', NULL ); 
  $option = bw_array_get( $atts, 'option', NULL );
  $banner = bw_array_get( $atts, 'banner', null );
  bw_trace( $atts, __FUNCTION__, __LINE__, __FILE__, "atts" );
  
  $table = bw_validate_torf( $table );
  $link = bw_get_notes_page_url( $link );
  //return( "bw_plug dummy" );
  
  bw_trace( $table, __FUNCTION__, __LINE__, __FILE__, "table", BW_TRACE_DEBUG );
  
  if ( !empty( $option ) ) {
    $names = bw_plug_list_plugins( $option );
  } else {
    $name = wp_strip_all_tags( $name, TRUE );
    $names = explode( ",", $name );
  }
  
  // Force table format if there is more than one plugin name listed
  if ( count( $names) > 1 )
    $table = true;
  
  bw_plug_table( $table );

  foreach ( $names as $name ) {
  
    $name = bw_plugin_namify( $name );
  
    $plugininfo = bw_get_plugin_info( $name, $table );
    bw_trace( $plugininfo, __FUNCTION__, __LINE__, __FILE__, "plugininfo", BW_TRACE_INFO );
    if ( is_array( $plugininfo ) ) {
      $plugininfo = (object) $plugininfo;
    } 
    
    if ( is_wp_error( $plugininfo ) || !$plugininfo || !property_exists( $plugininfo, "name" ) ) {
      if ( $table ) {
        bw_format_plug_table( $name, $link, FALSE );
      }  
      else {
        bw_format_default( $name, $link );
      } 
    }   
    else {
      $plugininfo->short_description = bw_get_property( $plugininfo, "short_description", null );
      if ( $table ) {
        bw_format_plug_table( $name, $link, $plugininfo );
      }  
      else {
        bw_format_link( $name, $link, $plugininfo, $banner );
      }  
    }  
  } 
  bw_plug_etable( $table ); 
  return( bw_ret());  
}
 
 View on GitHub

Called by

    Invoked by

      Calls

      1 to 12 of 12
      • bw_format_default() – We don’t know about this plugin so we assume it’s a WordPress one WordPress will do its 404 processing to help us The link to the notes page, if required, may have difficult too
      • bw_format_link() – Format a link or links to the plugin
      • bw_format_plug_table() – Format the bw_plug output as a table with a number of columns 1.
      • bw_get_notes_page_url() – Get the URL structure for the notes page
      • bw_get_plugin_info_cache2() – Cache load of plugin info – new version
      • bw_plug() – Implement [bw_plug] shortcode
      • bw_plugin_namify() – Return what might be the plugin name with hyphens and lowercase chars
      • bw_plug_etable() – table footer for bw_plug
      • bw_plug_list_plugins() – get a simple list of plugin names satisfying the option value Note: ‘active-plugins’ is the only value you can currently use
      • bw_plug_table() – table header for bw_plug
      • bw_ret() – Use bw_ret() to return the contents of $bwecho, leaving the global value as NULL
      • bw_validate_torf() – Validate as true or false

      Call hooks

      Function name: bw_plug
      Plugin ref: oik-bob-bing-wide – more blocks and lazy smart shortcodes
      Version: 2.3.0
      Sourcefile: shortcodes/oik-plug.php
      File ref: shortcodes/oik-plug.php
      API type: shortcode
      Deprecated?: No
      API Letters:

      Published: November 2, 2012 | Last updated: September 14, 2015

      Information

      Function name: bw_plug
      Plugin ref: oik-bob-bing-wide – more blocks and lazy smart shortcodes
      Version: 2.3.0
      Sourcefile: shortcodes/oik-plug.php
      File ref: shortcodes/oik-plug.php
      API type: shortcode
      Deprecated?: No
      API Letters:

      Recent plugin updates

      oik-weight-zone-shipping v0.2.13 oik-weight-zone-shipping v0.2.13 has been tested with WooCommerce 10.1.2 and WordPress 6.8.2 ...
      SB Children Block v1.3.0 Upgrade to SB Children Block v1.3.0 for support for PHP 8.3 and PHP 8.4  ...
      oik v4.15.3 Update to oik v4.15.3 for a couple of security fixes. Tested with WordPress 6.8.2 ...
      oik-privacy-policy v1.4.9 Update to oik-privacy-policy v1.4.9 for a security fix. Tested with WordPress 6.8.2 and PHP 8.3 and PHP 8.4 ...
      oik-nivo-slider v1.17.0 oik-nivo-slider v1.17.0 introduces the Nivo slider block - oik-nivo-slider/nivo. ...

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


      Website designed and developed by Herb Miller of Bobbing Wide
      Proudly powered by WordPress and oik-plugins

      WordPress version: 6.8.3

      Gutenberg version: 21.7.0

      PHP version: 8.2.29