短代码是一个自结束标记,就像我们在 基本短代码 第节。 缩写是封闭内容。
附件内容
要操作的[wporg]内容[/wporg]
处理封闭内容
函数wporg_shortcode($atts=array(),$content=null){ //对$content做点什么 //总是返回 返回$content; } add_shortcode('wporg','wpoorg_shortcode');
. The
短代码识别
[wporg]还包括另一个[shortcode]
函数wporg_shortcode($atts=array(),$content=null){ //对$content做点什么 //递归运行短代码分析器 $content=do_shortcode($content); //始终返回 return$content; } add_shortcode('wporg','wpoorg_shortcode');
限制
非封闭内容