Table des matières

Customize Admin

Supprimer des widgets du tableau de bord

    add_action('wp_dashboard_setup', [$this,'wp_dashboard_setup'] );
 
    public function wp_dashboard_setup()
    {
        global $wp_meta_boxes ;
 
        // Wordpress metaboxes
 
        // Welcome Wordpress
        remove_action('welcome_panel', 'wp_welcome_panel');
        // Brouillon rapide
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
        // Évènements et nouveautés WordPress
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
 
        // Plugin metaboxes
        // Not yet presents in $wp_meta_boxes[]
        // but set them to "false" so that they won't be present/visible ...
 
        // SiteOrigin Page Builder News
        $wp_meta_boxes['dashboard']['normal']['core']['so-dashboard-news'] = false ;
        // CreativeMinds WordPress News
        $wp_meta_boxes['dashboard']['normal']['core']['cminds_package_dashboard_widget'] = false ;
 
    }