Description
Implements the [bw_plug] shortcodeNotes:
- When the table parameter is set to true then the data is formatted in a table.
- A table header and footer is added.
[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 shortcodesSource
File name: oik-bob-bing-wide/shortcodes/oik-plug.phpLines:
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
API Letters:
