您可以创建自己的短代码,它将为您保存所有硬编码的短代码:
add_shortcode("my_five_forms","my_five_forms_handler");
function my_five_forms_handler($atts,$content =null){
$con = "[frm-entry-delete-link id=9 page_id=25 field_key=hsn108]
[frm-entry-delete-link id=12 page_id=25 field_key=cp7pi]
[frm-entry-delete-link id=13 page_id=25 field_key=ksa9qv]
[frm-entry-delete-link id=14 page_id=25 field_key=9zuf6o]
[frm-entry-delete-link id=15 page_id=25 field_key=w8w7op]";
return do_shortcode($con);
}
// and use it like this:
[my_five_forms]
或者创建一个将动态呈现所有表单的短代码
add_shortcode("my_n_forms","my_n_forms_handler");
function my_n_forms_handler($atts,$content=null){
extract( shortcode_atts( array(
\'id_page_key\' => \'\',
), $atts ) );
$con = \'\';
foreach((array)$id_page_key as $f){
$f = split(":",$f);
$con .= \' [frm-entry-delete-link id="\'.$f[0].\'" page_id="\'.$f[1].\'" field_key="\'.$f[2].\'"]\';
}
return do_shortcode($con);
}
//and you use it like this:
[my_n_forms id_page_key="12:25:hsn108,13:25:cp7pi"]