/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// disable default dashboard widgets function remove_dashboard_widgets() { global $wp_meta_boxes; } add_action('wp_dashboard_setup', 'remove_dashboard_widgets'); // disable default dashboard widgets function disable_default_dashboard_widgets() { remove_meta_box('dashboard_right_now', 'dashboard', 'core'); remove_meta_box('dashboard_recent_comments', 'dashboard', 'core'); remove_meta_box('dashboard_incoming_links', 'dashboard', 'core'); remove_meta_box('dashboard_plugins', 'dashboard', 'core'); remove_meta_box('dashboard_quick_press', 'dashboard', 'core'); remove_meta_box('dashboard_recent_drafts', 'dashboard', 'core'); remove_meta_box('dashboard_primary', 'dashboard', 'core'); remove_meta_box('dashboard_secondary', 'dashboard', 'core'); } add_action('admin_menu', 'disable_default_dashboard_widgets'); // admin see everything if (!current_user_can('manage_options')) { add_action('wp_dashboard_setup', 'disable_default_dashboard_widgets'); }