您可以使用remove\\u meta\\u box删除默认元框,然后使用add\\u meta\\u box将其重新添加到其他位置:
add_action(\'do_meta_boxes\', \'wpse33063_move_meta_box\');
function wpse33063_move_meta_box(){
remove_meta_box( \'postimagediv\', \'post\', \'side\' );
add_meta_box(\'postimagediv\', __(\'Featured Image\'), \'post_thumbnail_meta_box\', \'post\', \'normal\', \'high\');
}
以上答案来自以下线索:
How to change default position of WP meta boxes?更新
如果主要的问题仅仅是可用的元框数量,并且您认为每个用户都不需要所有的框,那么您可以使用添加到函数中的以下代码将它们隐藏在较低的用户角色或所有角色面前。php文件。注意-此方法仅隐藏元框,而不停用或删除它们。
//Hide Post Page Options from all except Administrator
if (!current_user_can(\'administrator\')){
function hide_post_page_options() {
global $post;
$hide_post_options = "<style type=\\"text/css\\"> #wptotwitter_div, wpseo_meta, #al2fb_meta, #misc-publishing-actions .misc-pub-section label, #misc-publishing-actions .misc-pub-section #post-status-display, #misc-publishing-actions .misc-pub-section .edit-post-status, #visibility.misc-pub-section, .al2fb_post_submit, #slugdiv, #edit-slug-box, #screen-options-link-wrap { display: none; }</style>";
print($hide_post_options);
}
add_action( \'admin_head\', \'hide_post_page_options\' );
}
//Hide Post Page Options from ALL users
function hide_all_post_page_options() {
global $post;
$hide_all_post_options = "<style type=\\"text/css\\"> #taxonomy-category li.hide-if-no-js, #commentstatusdiv, #wypiekacz_sectionid, #postexcerpt, #trackbacksdiv, #postcustom, #yarpp_relatedposts { display: none !important; }</style>";
print($hide_all_post_options);
}
add_action( \'admin_head\', \'hide_all_post_page_options\' );
基本上,只需输入div id或类,并用逗号分隔。我只是把我的放在那里,以表明各种元框和区域都可以隐藏。
#wptotwitter_div - WP to Twitter plugin
#wpseo_meta - Wordpress SEO by Yoastplugin
#al2fb_meta, .al2fb_post_submit - Add Link to Facebookplugin
#misc-publishing-actions .misc-pub-section label, #misc-publishing-actions .misc-pub-section #post-status-display, #misc-publishing-actions .misc-pub-section .edit-post-status, #visibility.misc-pub-section - Default Wordpress Publish Status and Visibility
#slugdiv, #edit-slug-box - The post slug
#screen-options-link-wrap - The "Screen Options" tab at the top of the page
#taxonomy-category li.hide-if-no-js - The "Most Used" categories tab
#commentstatusdiv - The comments on the post
#wypiekacz_sectionid - Wypiekacz plugin
#postexcerpt - Post excerpt
#trackbacksdiv - Trackbacks
#postcustom - Custom post fields
#yarpp_relatedposts - Yet Another Related Posts Plugin
(我将示例放在“代码”中,因为SE使用#表示标题)
我想我会把这个扔给你,因为和你一样,我对所有的元框都感到非常失望,但最终我认为这是不需要的框的数量。对于“A”;“作者”;在我的网站上,它现在非常精简:标题、内容、另存为草稿、立即发布或发布时间表、标签、类别和特色图片。。。完全没有杂乱。