You appear to be a bot. Output may be restricted
Description
Return the function to invoke for the shortcodeWe need to cater for callbacks which are defined as object and function
- Array
Usage
$string = bw_get_shortcode_function( $shortcode, $callback );
Parameters
- $shortcode
- ( string ) required – the shortcode to invoke
- $callback
- ( mixed ) optional – default callback for the shortcode, if the 'all' or 'the_content' event is not defined for the shortcode.
Returns
string callable name for the shortcode functionSource
File name: oik/shortcodes/oik-codes.phpLines:
1 to 13 of 13
function bw_get_shortcode_function( $shortcode, $callback=null ) { global $bw_sc_ev; $events = bw_array_get( $bw_sc_ev, $shortcode, null ); $function = bw_array_get_from( $events, 'all,the_content', $callback ); $callable_name = null; if ( !is_callable( $function, false, $callable_name ) ) { $callable_name = bw_array_get( $function, 1, $shortcode ); bw_trace2( $callable_name, "callable_name", false ); //bw_trace2( $bw_sc_ev, "unexpected result!" ); //bw_backtrace(); } return( $callable_name ); }View on GitHub View on Trac