WordPress.org

Support

Support » Multisite » How to add additional columns of info to the Super Admin > Sites list of sites?

How to add additional columns of info to the Super Admin > Sites list of sites?

  • Hello. I am wondering if there is a method for adding additional/removing unwanted columns of information shown in the list of sites under Super Admin > Sites. Currently in the List View, it displays ID, Domain, Last Updated, Registered, Users, and Mapping. I would like to remove the Registered and Users columns add a column showing the Privacy setting.

    Is anyone aware of plugin or other method for modifying the columns shown?

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • David Sader
    Participant

    @dsader

    I have the following “mu-plugin” snippets that I use with this plugin:

    http://wordpress.org/extend/plugins/more-privacy-options/

    First you need an add_filter function to remove the unwanted columns and add the Privacy column:

    <?php
    add_filter( 'wpmu_blogs_columns', 'ds_sites_cols', 1 );
    function ds_sites_cols( $sites_columns ) {
    		unset($sites_columns[ 'registered' ]);
    		unset($sites_columns[ 'users' ]);
    
    		$sites_columns[ 'blog_privacy' ] = __( 'Blog Privacy' );
    
    		return $sites_columns;
    }
    ?>

    And then an add_action function to add the privacy settings under the new column heading:

    <?php
    add_action('manage_blogs_custom_column', 'ds_sites_privacy', 1, 2 );
    function ds_sites_privacy( $column, $blog_id ) {
    	if ( $column == 'blog_privacy') {
    		global $blog;
    		if ( '1' == $blog[ 'public' ] ) {
    			echo 'Visible(1)';
    		}
    		if ( '0' == $blog[ 'public' ] ) {
    			echo 'Block Search(0)';
    		}
    		if ( '-1' == $blog[ 'public' ] ) {
    			echo 'Network Members Only(-1)';
    		}
    		if ( '-2' == $blog[ 'public' ] ) {
    			echo 'Blog Users Only(-2)';
    		}
    		if ( '-3' == $blog[ 'public' ] ) {
    			echo 'Admins Only(-3)';
    		}
    	}
    }
    ?>

    Thanks, David. I’ll try this out.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to add additional columns of info to the Super Admin > Sites list of sites?’ is closed to new replies.