You appear to be a bot. Output may be restricted
Description
Attempt to find the function that will handle the additional processing for the shortcodeSome shortcodes contain hyphens rather than underscores. e.g. wp-members We need to translate these to underscores before searching for the function. And some contain periods. e.g. blip.tv. These need translating too. If the function does not exist we see if it's in the file that implements the shortcode. If it's not then we return the default function name, which is:
- _sc__help: for shortcode help
- _sc__example: for shortcode example
- _sc__syntax: for shortcode syntax
Usage
$string = bw_load_shortcode_suffix( $shortcode, $suffix );
Parameters
- $shortcode
- ( string ) required – the name of the shortcode – NOT the shortcode function
- $suffix
- ( string ) required – the additional processing required: e.g. __help, __example, __syntax
Returns
string $funcname – the function that exists to handle this requestSource
File name: oik/libs/oik-sc-help.phpLines:
1 to 15 of 15
function bw_load_shortcode_suffix( $shortcode, $suffix ) { $_shortcode = str_replace( "-", "_", $shortcode ); $_shortcode = str_replace( ".", "_", $_shortcode ); // bw_trace2( $_shortcode, "underscored shortcode" ); $testfunc = $_shortcode . $suffix; if ( function_exists( $testfunc ) ) { $funcname = $testfunc; } else { $funcname = '_sc'. $suffix; if ( bw_load_shortcodefile( $shortcode ) && function_exists( $testfunc ) ) { $funcname = $testfunc; } } return( $funcname ); }View on GitHub View on Trac