user1419810
user1419810

Reputation: 846

Network admin "Sites" page - Wordpress

I'm running a Wordpress multisite network, to manage the sites on the network I go to the "sites"page which displays the following headings:

URL - Last Updated - Registered - Users

To make this more useful I'd like to add the name of the site to this table. I have now added a column through using this code:

add_filter('wpmu_blogs_columns', 'add_site_name_column');
function add_site_name_column($site_columns) {
    $site_columns['site_name'] = 'Site Name';
    return $site_columns;
}

However I cant now work out how to put the site name into the column?

Upvotes: 0

Views: 248

Answers (1)

random_user_name
random_user_name

Reputation: 26160

Check in the file wp-admin/includes/class-wp-ms-site-list-table.php, specifically look for the get_columns method.

The key to doing this will be for you to add a filter that works with the columns:

add_filter( 'wpmu_blogs_columns', 'my_custom_blog_columns' );

function my_custom_blog_columns( $sites_columns ) {
    // Modify $site_columns here....
    return $site_columns;
}

Typically you would add this filter in your theme's functions.php file, or in the plugin file(s) you are developing.

Upvotes: 1

Related Questions