如您所述,将quicktags设置为false将删除“视觉”和“文本”选项卡。因此,要离开选项卡,需要将quicktags设置为true并删除按钮:
$settings = array(
\'quicktags\' => array(
\'buttons\' => \',\'
)
);
wp_editor($input, \'editor_name\', $settings);
要在您可以使用的所有quicktags实例中都具有此功能
quicktags_settings
过滤器:
add_filter(\'quicktags_settings\', \'cyb_quicktags_settings\');
function cyb_quicktags_settings( $qtInit ) {
//Set to emtpy string, empty array or false won\'t work. It must be set to ","
$qtInit[\'buttons\'] = \',\';
return $qtInit;
}
如果您使用的插件添加自定义quicktags,则可能需要为过滤器设置高优先级参数(稍后执行):
add_filter(\'quicktags_settings\', \'cyb_quicktags_settings\', 100);