Here’s an overview of the developer facing changes made in multisitemultisite Used to describe a WordPress installation with a network of multiple blogs, grouped by sites. This installation type has shared users tables, and creates separate database tables for each blog (wp_posts becomes wp_0_posts). See also network, blog, site for the 4.8 cycle. If you’re interested in more detail, checkout the full list of tickets.
New capabilitiescapability A capability is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on their role. For example, users who have the Author role usually have permission to edit their own posts (the “edit_posts” capability), but not permission to edit other users’ posts (the “edit_others_posts” capability).
As part of the goal to remove all calls to is_super_admin() in favor of capabilitycapability A capability is permission to perform one or more types of task. Checking if a user has a capability is performed by the current_user_can function. Each user of a WordPress site might have some permissions but not others, depending on their role. For example, users who have the Author role usually have permission to edit their own posts (the “edit_posts” capability), but not permission to edit other users’ posts (the “edit_others_posts” capability). checks, two new metaMeta Meta is a term that refers to the inside workings of a group. For us, this is the team that works on internal WordPress sites like WordCamp Central and Make WordPress. capabilities have been introduced in this release:
upgrade_networkis used to determine whether a user can access the Networknetwork (versus site, blog) Upgrade page in the network adminadmin (and super admin). Related to this, the capability is also checked to determine whether to show the notice that a network upgrade is required. The capability is not mapped, so it is only granted to network administrators. See #39205 for background discussion.setup_networkis used to determine whether a user can setup multisite, i.e. access the Network Setup page. Before setting up a multisite, the capability is mapped to themanage_optionscapability, so that it is granted to administrators. Once multisite is setup, it is mapped tomanage_network_options, so that it is granted to network administrators. See #39206 for background discussion.
Both capabilities work in a backward-compatible fashion, so no changes should be required in plugins that deal with those areas. The capabilities however allow more fine-grained control about access to their specific areas. As an additional reminder: Usage of is_super_admin(), while not throwing a notice, is discouraged. If you need to check whether a network administrator has access to specific functionality in your pluginPlugin A plugin is a piece of software containing a group of functions that can be added to a WordPress website. They can extend functionality or add new features to your WordPress websites. WordPress plugins are written in the PHP programming language and integrate seamlessly with WordPress. These can be free in the WordPress.org Plugin Directory https://wordpress.org/plugins/ or can be cost-based plugin from a third-party., use one of the existing network capabilities or a custom capability. See #37616 for the ongoing task.
New HooksHooks In WordPress theme and development, hooks are functions that can be applied to an action or a Filter in WordPress. Actions are functions performed when a certain event occurs in WordPress. Filters allow you to modify certain functions. Arguments used to hook both filters and actions look the same.
deleted_blogfires after a site has been deleted. See #25584signup_site_metafilters site meta inwpmu_signup_blog(). See #39223signup_user_metafilters user meta inwpmu_signup_user(). See #39223minimum_site_name_lengthfilters the minimum number of characters that can be used for new site signups. See #39676
Network-specific site and user count control
With WordPress 4.8, several functions related to network site and user counts now support an additional $network_id parameter that allows to read and update those counts on a different network than the current one. While this mostly increases general flexibility, the new parameter can be leveraged to fix inconsistencies, for example prior to 4.8 the creation of a new site on another network would falsely trigger a recalculation of the current network instead of the network being actually modified. See #38699 for the bugbug A bug is an error or unexpected result. Performance improvements, code optimization, and are considered enhancements, not defects. After feature freeze, only bugs are dealt with, with regressions (adverse changes from the previous version) being the highest priority. ticketticket Created for both bug reports and feature development on the bug tracker. and resulting task.
The functions that now support a $network_id parameter are:
get_blog_count(). See #37865.get_user_count(). See #37866.wp_update_network_site_counts(). See #37528.wp_update_network_user_counts(). See #40349.wp_update_network_counts(). See #40386.wp_maybe_update_network_site_counts(). See #40384.wp_maybe_update_network_user_counts(). See #40385.wp_is_large_network(). The filterFilter Filters are one of the two types of Hooks https://codex.wordpress.org/Plugin_API/Hooks. They provide a way for functions to modify data of other functions. They are the counterpart to Actions. Unlike Actions, filters are meant to work in an isolated manner, and should never have side effects such as affecting global variables and output.wp_is_large_networknow passes the network ID as fourth parameter as well. See #40489.