Add new column to sites page

here is a modified version of your class that should work: class Add_Blog_ID { public static function init() { $class = __CLASS__ ; if ( empty( $GLOBALS[ $class ] ) ) $GLOBALS[ $class ] = new $class; } public function __construct() { add_filter( ‘wpmu_blogs_columns’, array( $this, ‘get_id’ ) ); add_action( ‘manage_sites_custom_column’, array( $this, ‘add_columns’ ), … Read more

Changing Multisite themes on mass

I wouldn’t recommend to use update_option for this task. Why? Because themes/plugins may use switch_theme action and it won’t get run in such case. And this action is pretty important – it will allow you to save your widgets for example… Another problem with Fuxias answer is that she uses template_directory hook. But there is … Read more

Perform action on WPMU blog deletion

Yes, inside /wp-admin/includes/ms.php there is the action hook delete_blog. This test prevents a blog deletion: add_action( ‘delete_blog’, ‘prevent_blog_delete_wpse_82961’, 10, 2 ); /** * @param int $blog_id Blog ID * @param bool $drop True if blog’s table should be dropped. Default is false. */ function prevent_blog_delete_wpse_82961( $blog_id, $drop ) { wp_die( ‘aborting delete_blog’ ); }

Allowing periods in usernames

There is a plugin for this. It is Network Username Restrictions Override. Please remember to check out the FAQ #2 to know how to allow periods in usernames. Let me quote it here… You’ll have to update the regular expressions in your .htaccess file if you use email addresses or periods in site URLs. The … Read more

How to set configuration options for particular sub blogs?

Hi @Raj Sekharan: If I understand your question lets say you have three (3) subdomains on your multisite and you only want to debug the first? http://foo.example.com http://bar.example.com http://baz.example.com If yes then it’s a simply matter of adding the following to your /wp-config.php file: if ($_SERVER[‘HTTP_HOST’]==’foo.example.com’) define(‘WP_DEBUG’, true); else define(‘WP_DEBUG’, false); Or if you are … Read more

How do I query all posts of one type across my multisite installation?

Yes but not in a single query, e.g.: if(is_multisite()){ global $wpdb; $blogs = $wpdb->get_results($wpdb->prepare(“SELECT * FROM $wpdb->blogs WHERE spam = ‘0’ AND deleted = ‘0’ and archived = ‘0’ and public=”1″”)); if(!empty($blogs)){ ?><?php foreach($blogs as $blog){ switch_to_blog($blog->blog_id); $details = get_blog_details($blog->blog_id); $q = new WP_query(); if($q->have_posts()){ while($q->have_posts()){ $q->the_post(); // do things break; } } wp_reset_query(); restore_current_blog(); … Read more

How to add super admin to all sites

Super admins do have access to all sites, but they don’t show up in “My Sites” by default, which I imagine is where you’re looking. They’ll want to go to the network admin (/wp-admin/network/, then go to all sites from there, then find the site they want to edit and click “Dashboard” (which appears on … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)