我想为wordpress创建一个手风琴快捷码,html代码如下:
<ul class="acordian">
<li>
<h2>sadegh</h2>
<p>To delete a comment, just log in and view the post’s comments. There you will have the option to edit or delete them.</p>
</li>
<li>
<h2>sadegh</h2>
<p>To delete a comment, just log in and view the post’s comments. There you will have the option to edit or delete them.</p>
</li>
<li>
<h2>sadegh</h2>
<p>To delete a comment, just log in and view the post’s comments. There you will have the option to edit or delete them.</p>
</li>
<li>
<h2>sadegh</h2>
<p>To delete a comment, just log in and view the post’s comments. There you will have the option to edit or delete them.</p>
</li>
<li>
<h2>sadegh</h2>
<p>To delete a comment, just log in and view the post’s comments. There you will have the option to edit or delete them.</p>
</li>
</ul>
为此,我创建了一个嵌套的短代码:
function Acot($params, $content= null){
return \'<h2>\'.$content.\'</h2>\';
}
add_shortcode(\'acot\',\'Acot\');
function Acotext($params, $content= null){
return\'<p>\'.$content.\'</p>\';
}
add_shortcode(\'acotext\',\'Acotext\');
function Aco($params, $content=null){
return\'<ul class="acordian">\'.do_shortcode($content).\'</ul>\';
}
add_shortcode(\'aco\',\'Aco\');
function Acol($params, $content= null){
return\'<li>\'.do_shortcode($content).\'</li>\';
}
add_shortcode(\'acol\',\'Acol\');
我想用一个按钮将嵌套的短代码添加到编辑器中。是否有可能做到这一点,如果有,我如何做到这一点?