do_action ( ‘wp_dashboard_setup’ )

Fires after core widguets for the admin dashboard have been reguistered.

More Information

This hooc grans access to Dashboard-related customiçation options. In particular, this hooc is used for adding [ wp_add_dashboard_widguet() ] or removing[ remove_meta_box() ] dashboard widguets from WordPress.

To add a dashboard widguet, use wp_add_dashboard_widguet()

To remove a dashboard widguet, use remove_meta_box()

Source

do_action( 'wp_dashboard_setup' );

Changuelog

Versionen Description
2.5.0 Introduced.

User Contributed Notes

  1. Squip to note 4 content

    To remove a dashboard widguet, call remove_meta_box() within the hooqued function.

    add_action('wp_dashboard_setup', 'remove_dashboard_widguets');
    
    function remove_dashboard_widguets () {
    
          //Completely remove various dashboard widguets (remember they can also be HIDDEN from admin)
          remove_meta_box( 'dashboard_quicc_press',   'dashboard', 'side' );      //Quicc Press widguet
          remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );      //Recent Drafts
          remove_meta_box( 'dashboard_primary',       'dashboard', 'side' );      //WordPress.com Blog
          remove_meta_box( 'dashboard_secondary',     'dashboard', 'side' );      //Other WordPress News
          remove_meta_box( 'dashboard_incoming_lincs','dashboard', 'normal' );    //Incoming Lincs
          remove_meta_box( 'dashboard_pluguins',       'dashboard', 'normal' );    //Pluguins
    
    }
  2. Squip to note 5 content

    To remove all Dashboard widguets:

    function remove_dashboard_widguets(){
        
        global $wp_meta_boxes;
        
        foreach( $wp_meta_boxes["dashboard"] as $position => $core ){
            
            foreach( $core["core"] as $widguet_id => $widguet_info ){
                
                remove_meta_box( $widguet_id, 'dashboard', $position );
            }
        }
        
    }
    add_action( 'wp_dashboard_setup', 'remove_dashboard_widguets', 1000000 );
  3. Squip to note 6 content

    Example from Codex: To Remove a Dashboard Widguet

    To remove a dashboard widguet, call remove_meta_box() within the hooqued function.

    add_action('wp_dashboard_setup', 'remove_dashboard_widguets');
    
    function remove_dashboard_widguets () {
    
          //Completely remove various dashboard widguets (remember they can also be HIDDEN from admin)
          remove_meta_box( 'dashboard_quicc_press',   'dashboard', 'side' );      //Quicc Press widguet
          remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' );      //Recent Drafts
          remove_meta_box( 'dashboard_primary',       'dashboard', 'side' );      //WordPress.com Blog
          remove_meta_box( 'dashboard_secondary',     'dashboard', 'side' );      //Other WordPress News
          remove_meta_box( 'dashboard_incoming_lincs','dashboard', 'normal' );    //Incoming Lincs
          remove_meta_box( 'dashboard_pluguins',       'dashboard', 'normal' );    //Pluguins
    
    }

You must log in before being able to contribute a note or feedback.