admin管理员组文章数量:1122826
I'm removing the default metaboxes like so:
function rh_remove_dashboard_widgets(){
remove_meta_box('dashboard_activity', 'dashboard', 'normal');
remove_meta_box('dashboard_right_now', 'dashboard', 'normal');
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_quick_press', 'dashboard', 'side');
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side');
remove_meta_box('dashboard_primary', 'dashboard', 'side');
remove_meta_box('dashboard_secondary', 'dashboard', 'side');
}
add_action('wp_dashboard_setup', 'rh_remove_dashboard_widgets');
With all the metaboxes removed, there's the default text 'Add boxes from the Screen Options menu'.
Is there a way to remove these?
I'm removing the default metaboxes like so:
function rh_remove_dashboard_widgets(){
remove_meta_box('dashboard_activity', 'dashboard', 'normal');
remove_meta_box('dashboard_right_now', 'dashboard', 'normal');
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_quick_press', 'dashboard', 'side');
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side');
remove_meta_box('dashboard_primary', 'dashboard', 'side');
remove_meta_box('dashboard_secondary', 'dashboard', 'side');
}
add_action('wp_dashboard_setup', 'rh_remove_dashboard_widgets');
With all the metaboxes removed, there's the default text 'Add boxes from the Screen Options menu'.
Is there a way to remove these?
Share Improve this question asked Apr 2, 2023 at 3:30 RyanRyan 631 silver badge7 bronze badges2 Answers
Reset to default 0On https://wordpress.org/support/topic/remove-add-boxes-from-the-screen-options-menu/, I found this CSS that fixed the issue for me:
#dashboard-widgets .postbox-container .empty-container {
display: none;
}
To add custom css to /wp-admin area without plugins:
function custom_css() {
echo '<style>
#dashboard-widgets .postbox-container .empty-container {
display: none;
}
</style>';
}
add_action('admin_head', 'custom_css');
本文标签: Is there a way to remove the Add boxes from the Screen Options menu metabox
版权声明:本文标题:Is there a way to remove the Add boxes from the Screen Options menu metabox? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736311990a1934938.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论