我想只要您还使用类似于th wp\\u kses函数的过滤器来验证正在传递的标记,就可以了。
extract( shortcode_atts( array(
\'count\' => -1,
\'category_name\' => \'\',
\'q_before\' => \'<h3>\',
\'q_after\' => \'</h3>\',
\'orderby\' => \'date\', //\'none\',\'ID\',\'author\',\'title\',\'name\',\'date\',\'modified\',\'parent\',\'rand\',\'menu_order\'
\'order\' => \'ASC\', //\'DESC\'
), $atts, \'myfaq\' ) );
$allowed_tags = array(
\'a\' => array(
\'href\' => array(),
\'title\' => array()
),
\'br\' => array(),
\'em\' => array(),
\'strong\' => array(),
);
$q_before = wp_kses(html_entity_decode( $q_before ),$allowed_tags);
$q_after = wp_kses(html_entity_decode( $q_after ),$allowed_tags);
这将允许用户输入多个标签,但只能输入br、em、strong和a标签,并且只能输入链接的属性href和标题