WordPress 4.4 has been a very productive release for multisite. In addition to some exciting new enhancements, we were able to resolve some long standing bugs. Check out the full list of multisite focused changes on Trac if you want even more wonderful reading material. 💖
$current_site global has been maintaining a
stdClass object representing an assumed description of a network since the original merge of WordPress MU with WordPress. With the introduction of
WP_Network, we give a network a bit more definition and open up possibilities for working with a network (or networks) in a more sane way.
Take a look at
ms-settings.php if you are using a custom sunrise.php to populate the
$current_site globals. We now create a
WP_Network object from the existing
$current_site if it has been populated elsewhere. This is a backward compatible change, though should be tested wherever your code interacts with
$current_site, especially if anything has been done to extend its structure.
See #31985 for more discussion while this was built.
Introduce *_network_option functions
During the introduction of WP_Network, we needed a way to populate network options (stored in
wp_sitemeta) for a network other than the current.
delete_network_option() are all new functions in 4.4. Each takes the network ID as its first argument, matching the structure of the
*_site_option() functions remain as the proper way for working with a current network’s options. These now wrap the new
*_network_option() functions and pass the current network’s
In a future release, likely 4.5, we can look at the introduction of network 0 as a way to store global options.
See #28290 for more discussion.
New actions and filters
before_signup_headerfires before the signup header in
ms_network_not_foundfires when the
$current_siteglobal has not been filled and
ms_not_installed()is about to fire. #31702
invite_userfires immediately after a user is invited to join a site, but before the notification is sent. #33008
Other enhancements of note:
- WordPress has always enforced a
/blogprefix for the main site’s permalink structure to avoid collisions with other sites in a subdirectory configuration. This was always changeable in the network admin, though the permalinks UI in the site admin never reflected the change and could cause confusion. Now, thanks to #12002, WordPress forgets that
/blogwas ever assigned if it is changed in the network admin to anything else. When changing this value, choose something that won’t conflict.
manage_network_usersis now used to determine
edit_userscaps rather than
is_super_admin. In preparation for 4.4, take a look at how you’re using the
manage_network_userscapability in your code to be sure access is set as intended. #16860
- Network activated plugins are now visible as “network activated” in an individual site admin if the user can manage network plugins. These are not shown to site administrators. #20104
- Recently active plugins are now displayed as such in the network admin. #20468
- Language selection is now available when adding a new site through the network admin. 🌍 #33528
- Language selection is also now available when signing up for a new site through
wp-signup.php. 🌏 #33844
- Network user searching has been improved by wrapping search terms in asterisk for looser matching. #32913
Bugs of note fixed:
- It was previously impossible to set the upload limit for an individual site to 0 as it would then fallback to the default of 100MB. In 4.4, 0 is a respected number. #34037
- When a site’s home, siteurl, or page_on_front option was updated in the network admin, rewrite rules were previously flushed incorrectly, causing rewrite rules for the main site on the network to take the place of the rewrite rules for the site being changed. #33816
- Subdirectory sites created on an HTTPS network are now set to HTTPS rather than the incorrect HTTP. 🔒 #33620
- A site’s title can now be longer than 50 characters! #33973
get_admin_users_for_domain() #34122 and
create_empty_blog() #34120 have never been used by WordPress core and are now deprecated. 🍻