[wp-trac] [WordPress Trac] #37923: Introduce shared wp_blogmeta database table for multisite installation
WordPress Trac
noreply at wordpress.org
Wed Aug 23 14:11:49 UTC 2017
#37923: Introduce shared wp_blogmeta database table for multisite installation
-------------------------------------------------+-------------------------
Reporter: johnjamesjacoby | Owner:
Type: feature request | spacedmonkey
Priority: normal | Status: assigned
Component: Networks and Sites | Milestone: 4.9
Severity: normal | Version:
Keywords: has-patch has-unit-tests needs- | Resolution:
testing ms-roadmap | Focuses: multisite
-------------------------------------------------+-------------------------
Comment (by spacedmonkey):
In 37923.eachnetwork.diff the network option is only set in two places.
First on a network upgrade, which is a reasonable thing to do. Second in
the `is_site_meta_enabled` function.
It also fixes the following condition.
0. Upgrade to WP 4.9+
0. Code calls get_site_meta
0. Check is run, table is not found, option is set to 0.
0. All following calls fail because check is set to 0.
0. Upgrade is run, table is installed, network option is set 1.
0. Following calls work, as table exists and check is correctly set.
Site meta can be disabled by the filter `site_meta_supported`. Having it
as a network option, just makes that a little easier. But if you want to
disable the function on network, you can just do this.
{{{#!php
add_filter('site_meta_supported', function($enabled){
$network = get_network();
if($network->id == 2){
$enabled = false;
}
return $enabled;
});
}}}
Worth noting that global terms and ms_files_rewriting can be disabled per
network.
It also allows you to write a custom install script that installs the
table and set the value to 1 on all networks. This makes it is easier for
people running a large multisite setup.
Like term meta, we will never to able to truly know that this table is
installed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37923#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list