Delete pages and Create default pages for all new network sites

I’m really not sure where your logic is failing and haven’t revised each one of your insert/delete hooks. But the code can be greatly simplified to only call each function once, thus making it easy to make it work. add_action( ‘wpmu_new_blog’, ‘setup_blog_wpse_114119’, 10, 2 ); function setup_blog_wpse_114119( $blog_id, $user_id ) { create_pages_wpse_114119( $blog_id, $user_id ); … Read more

Multisite network admin – URL / redirect error

network admin_url filter can rewrite network admin url. But i don’t know it is a best way or not. // wp-config.php /** Sets up WordPress vars and included files. */ require_once(ABSPATH . ‘wp-settings.php’); // add code // define(‘__WORDPRESS_CORE_DIR__’, ‘/wordpress’); add_filter(‘network_admin_url’, ‘rewrite_my_network_admin_url’, 10, 2); function rewrite_my_network_admin_url($url, $path) { $networkPath = str_replace( ‘/wp-admin/’, __WORDPRESS_CORE_DIR__ . ‘/wp-admin/’, $url … Read more

How to test for Super Admin

I got it to work as follows — in mu-plugins directory, my superAdmin.php script looks like this: <?php function check_for_superAdmin($user_login, $user) { $current_user = get_userdatabylogin($user_login); if ( is_super_admin( $current_user->ID ) ) { // do these things } else { // do other things } } add_action( ‘wp_login’, ‘check_for_superAdmin’, 10, 2 ); ?> Hope this helps … Read more

WordPress Multisite: Have the same header and footer of main-blog on all sub-blogs

You could use the switch_to_blog() function Switches the active blog until the user calls the restore_current_blog() function. This function is useful if you need to pull posts, or other information, from other blogs, you can then switch back after using restore_current_blog(). Using this function will not load plugins that only run on the blog you … Read more

No Network/Super admin after enabling Network

I installed WordPress 3.2.1 fresh on a new domain, and then enabled Multi-Site, which functioned as documented. I could reach /wp-admin/network without problems. Comparing the database of this WP with the problem installation, in the wp_sitemeta table, admin_email was not set for the problem site. Also, wp_sitemeta > site_admins was different. The problem website had … Read more

WordPress network: set themes and plugins for new blog

This WPSE answer led me to the $meta argument for wpmu_create_blog. That led me to this Support thread showing that $meta can include template and stylesheet arguments which seem to contain the folder name for the theme you want (just like the “Template” field in a child theme’s style.css head section). I’m having a hard … Read more