Skip to content

Instantly share code, notes, and snippets.

@AbhishekGhosh
Created January 13, 2015 17:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbhishekGhosh/897d36d120eb4c7f79d8 to your computer and use it in GitHub Desktop.
Save AbhishekGhosh/897d36d120eb4c7f79d8 to your computer and use it in GitHub Desktop.
WordPress Multisite ID Plugin
<?php
// must be placed under wp-content/mu-plugins/
// GNU GPL 3.0 Licence
// Digital Ocean created it, but WordPress is not their father's property
// hence DMCA safe harbour exists
// if they files DMCA, we will file a simple civil case for abusing law from Bombay High Court
// for abusing the Power of Law
// hence Github can not delete
// hence you should kiss me
// hence you might get hacked if you are not sure what it is
// hence if you are The President
// file DMCA
// eleseif
// do not file case.
// abusing law. huh? mother foo *ke -R
// you can fork, do not fear !
add_filter( 'wpmu_blogs_columns', 'do_get_id' );
add_action( 'manage_sites_custom_column', 'do_add_columns', 10, 2 );
add_action( 'manage_blogs_custom_column', 'do_add_columns', 10, 2 );
function do_add_columns( $column_name, $blog_id ) {
if ( 'blog_id' === $column_name )
echo $blog_id;
return $column_name;
}
function do_get_id( $columns ) {
$columns['blog_id'] = 'ID';
return $columns;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment