WordPress.org

Ready to get started?Download WordPress

Forums

User/Global/Network Admin Dashboard (4 posts)

  1. IKTP
    Member
    Posted 3 years ago #

    I need to add a custom dashboard widget and remove other widgets to my multisite. i.e. to remove some widgets from the dashboard for each site I add this to my functions.php:

    function remove_dashboard_widgets() {
    
    	global $wp_meta_boxes;
    	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    	unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
    }
    add_action('wp_dashboard_setup', 'remove_dashboard_widgets');

    But for a multisite the network admin has another dashboard, and when users register for my site (they register for all blogs) they see a global dashboard and these widgets dont get removed.

    Can someone please help me figure out where to add the code to remove these widgets from network admin and from the user/global dashboard and also if the code needs to be changed at all.

    Thanks.

  2. KatieBen
    Member
    Posted 3 years ago #

    Here's how I'm removing dashboard widgets:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Hope this helps :)

  3. Curtiss Grymala
    Member
    Posted 3 years ago #

    Also, if you're planning to do this on a global level, you'll probably want to put the code into a PHP file and upload it to wp-content/mu-plugins rather than trying to replicate the code in (potentially) multiple themes.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags