有人知道从页面编辑屏幕中删除主编辑器的方法吗?不仅仅是css。我用 tinymce 添加了一些其他元框,它们与主框发生碰撞。
我有一个从编辑屏幕中删除其他元框的类,但我不能以这种方式摆脱主编辑器。我尝试将“divpostrich”和“divpost”添加到类中的数组中(但没有运气):
class removeMetas{
public function __construct(){
add_action('do_meta_boxes', array($this, 'removeMetaBoxes'), 10, 3);
}
public function removeMetaBoxes($type, $context, $post){
/**
* usages
* remove_meta_box($id, $page, $context)
* add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default')
*/
$boxes = array( 'slugdiv', 'postexcerpt', 'passworddiv', 'categorydiv',
'tagsdiv', 'trackbacksdiv', 'commentstatusdiv', 'commentsdiv',
'authordiv', 'postcustom');
foreach ($boxes as $box){
foreach (array('link', 'post', 'page') as $page){
foreach (array('normal', 'advanced', 'side') as $context){
remove_meta_box($box, $type, $context);
}
}
}
}
}
$removeMetas = new removeMetas();
我也试过用 jquery 删除'divpostrich'。但是无法弄清楚将js放在哪里才能工作。当我使用 firebug 在浏览器中删除“postdivrich”时 - 我剩余的 tinymce 字段运行良好。
有任何想法吗?