You appear to be a bot. Output may be restricted
Description
Expand an oik DIY shortcodeWhat happens if we go recursive? ? Note: We have use push and pop to handle nested shortcode expansion correctly Added logic to disable oikp_the_content() processing
Usage
$string = diy_oik_do_shortcode( $atts, $hmm, $tag );
Parameters
- $atts
- ( array ) optional – we don't expect any parameters
- $hmm
- ( string ) optional – this is the 'content' when the shortcode is coded [sc]content[/sc] – ignored
- $tag
- ( string ) optional – the shortcode being invoked
Returns
string the expanded shortcodeSource
File name: diy-oik/shortcodes/diy-oik.phpLines:
1 to 24 of 24
function diy_oik_do_shortcode( $atts=null, $hmm=null, $tag=null ) { $code = bw_array_get( $atts, 0, $tag ); $diy_code = bw_get_option( $code, "diy_codes" ); $content = bw_array_get( $diy_code, "content", "" ); $content = stripslashes( $content ); //bw_trace2( $content, "before the_content" ); oik_require( "includes/oik-filters.inc" ); bw_disable_filter( "the_content", "wpautop" ); bw_replace_filter( "the_content", "shortcode_unautop", 10, "bw_trace_filter" ); bw_replace_filter( "the_content", "oikp_the_content", 1, "bw_trace_filter" ); bw_push(); $content = apply_filters( 'the_content', $content ); bw_pop(); if ( function_exists( "bw_wpautop" ) ) { bw_restore_filter( 'the_content', 'bw_wpautop' , 99); } else { bw_restore_filter( "the_content", "wpautop" ); bw_restore_filter( "the_content", "shortcode_unautop" ); } bw_restore_filter( "the_content", "oikp_the_content" ); bw_trace2( $content, "after the_content" ); return( $content ); }