Admin Email Column in the Network Sites List
Lists each site's administration email address in Network Admin > Sites so you can contact site owners without opening every site.
Opens WPIDE on
Code
if ( ! is_multisite() ) {
return;
}
add_filter( 'wpmu_blogs_columns', function ( $columns ) {
$columns['wpide_admin_email'] = __( 'Admin email' );
return $columns;
} );
add_action( 'manage_sites_custom_column', function ( $column, $blog_id ) {
if ( 'wpide_admin_email' !== $column ) {
return;
}
$email = get_blog_option( $blog_id, 'admin_email' );
if ( is_email( $email ) ) {
printf( '<a href="mailto:%1$s">%2$s</a>', esc_attr( $email ), esc_html( $email ) );
} else {
echo '—';
}
}, 10, 2 );
Notes
""
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.