How do I park secure.primary.com on top of the multisite ID:1 domain: www.primary.com (primary multisite domain)

Install WordPress MU Domain MappingPlugin, and edit the wp_domain_mapping database table. Insert a new row for blog_id #1 manually, for example: +——+———–+———————-+———-+ | id | blog_id | domain | active | +——+———–+———————-+———-+ | 5 | 1 | secure.primary.com | 1 | +——+———–+———————-+———-+

How to set Active plugins as the default screen?

There are two options, modify the menu link href attribute or redirect the main screen. Modify menu Alter the global variable $submenu. This method works for Single and Multisite. Problem: the submenu item Installed Plugins doesn’t show in bold. add_action( ‘admin_head’, ‘b5f_plugins_redirect_to_active’ ); function b5f_plugins_redirect_to_active() { global $submenu; $submenu[‘plugins.php’][5][2] .= “?plugin_status=active”; return; } Redirect page … Read more

Default content for a new site in multi site

You could use a run-once plugin. The following is just some made-up code, not even tested. See it as a guide, not as a solution. 🙂 <?php /* Plugin Name: T5 Default Site Settings */ /* * Don’t start on every page, the plugin page is enough. */ if ( ! empty ( $GLOBALS[‘pagenow’] ) … Read more

Limit multisite/network site names to a property of the user

Looking at the source of wp-signup.php, it looks like your best bet might be to filter signup_blog_init (line 303 in v. 3.5.1): /* add_filter( ‘signup_blog_init’, ‘wpse103022_blog_name’ ); function wpse103022_blog_name( $blog_details ) { // Set $username to the user’s username $blog_details[‘blogname’] = $username; return $blog_details; } */ // see code below for replacement I’m not 100% … Read more

How to use both British and American English?

You can filter mu_dropdown_languages and re-add American English here. Sample code, not tested: add_filter( ‘mu_dropdown_languages’, function( $output, $lang_files, $current ) { array_unshift( $output, ‘<option value=””‘ . selected( $current, ‘en_US’, false ) . ‘>’ . __( ‘American English’ ) . “</option>” ); return $output; }, 10, 3 ); Filter sanitize_option_WPLANG or pre_update_option_WPLANG to jump into the … Read more

WP_INSERT_POST issue on WordPress Multisite

The hook declaration takes 6 parameters, yet none is in your function’s definition. Also, before calling the hook wpmu_new_blog, WP does a restore_current_blog(), so it’s safe to assume that we have to switch to the destination blog before inserting content. add_action( ‘wpmu_new_blog’, ‘new_blog_wpse_115724’, 10, 6 ); function new_blog_wpse_115724( $blog_id, $user_id, $domain, $path, $site_id, $meta ) … Read more

Installing multisite network admin on sub-domain

Yes. Here are the instructions: Install and configure WP for www.example.com Configure multisite – can use either sub-domain or sub-directory Install WP Domain Mapping plugin – http://wordpress.org/plugins/wordpress-mu-domain-mapping/ Create new site, e.g. site1 Using Domain Mapping plugin, map site (site1.www.example.com or www.example.com/site1) to preferred sitename (site1.example.com) I actually have two separate WP sites setup as above, … Read more

Using $wpdb Class to Pull Recent Comments Across a Network

Why not use get_comments(), instead of trying to roll your own with $wpdb? function display_sitewide_comments() { $sites = wp_get_sites(); $network_comments = array(); $max = 20; foreach( $sites as $site ) { switch_to_blog( $site->blog_id ); $args = array( ‘number’ => $max, ‘status’ => ‘approved’, ); $network_comments[$site->blog_id] = get_comments( $args ); restore_current_blog(); } // inspect the comments … Read more

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