Update blog option during create new blog?

The wpmu_new_blog hook is indeed deprecated and shouldn’t be used; however, it works because it runs after the new site has been initialized (see wp_initialize_site()) which means the database tables for that site has been created and filled with the default options. So because you are updating the site’s options like default_comment_status, then you should … Read more

How to check if page exists in Multisite?

get_page_by_path() will only search in the current site. If you need to find a page anywhere in your Multisite network, you can do something like this. function network_page_exists( $path ) { $args = array( // Max sites to retrieve. // If you have a large network, increase this. ‘number’ => 100, ); $sites = get_sites( … Read more

WP Multisite – Additional subdomain on the site for API purposes

I have resovled it myself. I have enabled sunrise in wp-config. Then add a script to sunrise.php to override HTTP_HOST. I made it dynamic since we have many websites. When you visit api.domainxy.com it automatically shows you domainxy.com. <?php $re=”/(?:api\.)(.*)/m”; $str = $_SERVER[‘HTTP_HOST’]; preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0); if ($matches && $matches[0][1] != “”) { … Read more

WordPress MU subdomain vhost

Basically, it turns out you need two dedicated IP addresses, or a third vhost. IP Address You could use two IP addresses and do something like this in your apache configuration: #IP address for WP NameVirtualHost 12.34.56.78:80 #For everything else NameVirtualHost *:80 Then, make sure the VirtualHost for WordPress is declared thus: <VirtualHost 12.34.56.78:80> and … Read more

Child Theme Based on Toolbox Not Found

You’re missing the Template Name for the parent theme. It should look like this: /* Theme Name: Charlie’s Repair Theme URI: http://wordpress.org/extend/themes/toolbox/ Author: Mike Wills Author URI: http://mikewills.me Template: toolbox Description: Based on the Toolbox theme from Automatic. This site is for Charlie’s Repair Version: 0.1 License: GNU General Public License License URI: license.txt Tags: … Read more

Multisite / Network – Stable?

The remarks were referring to non-technical people finding it harder to install and manage a network of sites, as opposed to a single WP installation. With regards to stability, it’s running on wordpress.com with millions of blogs and billions of pageviews, for crying out loud. 🙂