我有这样一个简单的短代码。。。。
function myshortcode( $attributes, $content = null ) {
extract( shortcode_atts( array(
\'class\' => \'\'
), $attributes ) );
return \'This is the content : \' . $content . \';
}
add_shortcode(\'my_shortcode\', \'myshortcode\');
这很有效,如果我在帖子中使用以下内容。。。[my_shortcode]This is the content that I want to display[/my_shortcode]
但我现在想做的是改变内容的字体大小,例如。。。[my_shortcode]This is the [25px]content[/25px] that I want to display[/my_shortcode]
我想将“content”一词更改为25px字体大小。有人知道怎么做吗,也许是str\\u替换?