wp plugin -17
var_dump( $shortcode_tags );
remove_shortcode()
remove_all_shortcodes()
strip_shortcodes()
< ?php
$content = < < < S
Some existing shortcodes: [amazonimage] [gallery]
These don’t exist: [bleh] [123]
S;
echo strip_shortcodes( $content );
/* Result:
Some existing shortcodes:
These don’t exist: [bleh] [123]
*/
? >
shortcode_atts()
do_shortcode().
Recursive Shortcodes,[b]some [i]text[/i] here[/b]
< ?php
// add shortcodes [b] and [i]
add_shortcode( ‘i’, ‘boj_sc5_italic’ );
add_shortcode( ‘b’, ‘boj_sc5_bold’ );
// callback function: return bold text
function boj_sc5_bold( $attr, $content ) {
return ‘ < strong > ’ . do_shortcode( $content ) . ‘ < /strong > ’;
}
// callback function: return italic text
function boj_sc5_italic( $attr, $content ) {
return ‘ < em > ’ . do_shortcode( $content ) . ‘ < /em > ’;
}
? >
浙公网安备 33010602011771号