Skip to content

Instantly share code, notes, and snippets.

@bystefu
Created December 30, 2020 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bystefu/542e368cc9d6498e6777a67f1b38c1b4 to your computer and use it in GitHub Desktop.
Save bystefu/542e368cc9d6498e6777a67f1b38c1b4 to your computer and use it in GitHub Desktop.
Remove default Metaboxes for first page Admin
<?php
if (!defined("STEFU_LOADED")) {
stopYou();
}
class Panel
{
/*
* prevent __construct
*/
function __construct()
{
}
/*
* Remove default Metaboxes from front page Admin Panel
*/
function uninstall_metaboxes()
{
add_action('admin_init', function () {
remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal');
remove_meta_box('dashboard_plugins', 'dashboard', 'normal');
remove_meta_box('dashboard_primary', 'dashboard', 'side');
remove_meta_box('dashboard_secondary', 'dashboard', 'normal');
remove_meta_box('dashboard_quick_press', 'dashboard', 'side');
remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side');
remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
remove_meta_box('dashboard_right_now', 'dashboard', 'normal');
remove_meta_box('dashboard_site_health', 'dashboard', 'normal');
remove_meta_box('dashboard_activity', 'dashboard', 'normal'); //since 3.8
});
remove_action('welcome_panel', 'wp_welcome_panel');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment