您可以使用过滤器自定义编辑器 (TinyMCE),如 here 所示。附代码sn-p:
function myformatTinyMCE($in)
{
$in['plugins']='inlinepopups,tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpfullscreen';
$in['wpautop']=true;
$in['apply_source_formatting']=false;
$in['theme_advanced_buttons1']='formatselect,forecolor,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,wp_fullscreen,wp_adv';
$in['theme_advanced_buttons2']='pastetext,pasteword,removeformat,|,charmap,|,outdent,indent,|,undo,redo';
$in['theme_advanced_buttons3']='';
$in['theme_advanced_buttons4']='';
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE' );
此代码应放在主题的functions.php 文件中。您可能想print_r( $in ) 查看所有传递的键(我在这里省略了一些键,因为我不相信我上面链接到的页面是最新的)。你可以浏览最新的源码here。您将在函数public static function editor_settings($editor_id, $set)中找到您要查找的过滤器
此外,您可能还需要确保这只发生在您的 baner post_type 上,因为这会影响已创建的编辑器的所有实例。