Multisite – WordPress 4.8

What? Multisite? Of course I mean changes to multisite networking. First thing first. The goal is to remove is_super_admin function. We still have it and it isn’t deprecated yet. Even more, WordPress 4.8 still uses this function. But still (third time!) it is planned, so we need something in spare. WordPress 4.8 bring us two new capabilities:
setup_network – if your site is single instance, this capability is mapped to manage_options and if you run multisite it is mapped to manage_network_options,
upgrade_network – this one isn’t mapped, it is granted for network administrators.

Besides new capabilities, we have four new hooks related to multisite. Those are:
minimum_site_name_length – this one is for new site sign-ups, it is self-explanatory,
signup_site_meta – filters site meta when in wpmu_signup_blog function,
signup_user_meta – this is similar to above, except it filters user meta (and is in wpmu_signup_user function),
deleted_blog – this is action when site has been deleted.

Biggest thing (in my opinion) – new $network_id parameter. When you work on your posts, pages, terms etc, you can always give $post_id, $term_id or similar $id variable to make function to work on other than current object. Now we may use $network_id to work on other blog in multisite configuration. This new parameter is for one filter (wp_is_large_network) and for seven functions: get_blog_count, get_user_count, wp_update_network_counts, wp_update_network_site_counts, wp_update_network_user_counts, wp_maybe_update_network_user_counts, wp_maybe_update_network_site_counts. This also resolved one bug in previous WordPress versions.

Leave a Reply

Your email address will not be published. Required fields are marked *