On this page
is_site_meta_supported(): bool
Determines whether site meta is enabled.
Description
This function checks whether the ‘blogmeta’ database table exists. The result is saved as a setting for the main network, making it essentially a global setting. Subsequent requests will refer to this setting instead of running the query.
Return
bool True if site meta is supported, false otherwise.
Source
File: wp-includes/functions.php. View all references
function is_site_meta_supported() {
global $wpdb;
if ( ! is_multisite() ) {
return false;
}
$network_id = get_main_network_id();
$supported = get_network_option( $network_id, 'site_meta_supported', false );
if ( false === $supported ) {
$supported = $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->blogmeta}'" ) ? 1 : 0;
update_network_option( $network_id, 'site_meta_supported', $supported );
}
return (bool) $supported;
}
Related
Uses
| Uses | Description |
|---|---|
| update_network_option() wp-includes/option.php | Updates the value of a network option that was already added. |
| get_network_option() wp-includes/option.php | Retrieves a network’s option value based on the option name. |
| get_main_network_id() wp-includes/functions.php | Gets the main network ID. |
| is_multisite() wp-includes/load.php | If Multisite is enabled. |
| wpdb::get_var() wp-includes/class-wpdb.php | Retrieves one variable from the database. |
Used By
| Used By | Description |
|---|---|
| wp_check_site_meta_support_prefilter() wp-includes/ms-site.php | Aborts calls to site meta if it is not supported. |
| wp_delete_site() wp-includes/ms-site.php | Deletes a site from the database. |
| populate_site_meta() wp-admin/includes/schema.php | Creates WordPress site meta and sets the default values. |
| upgrade_network() wp-admin/includes/upgrade.php | Executes network-level upgrade routines. |
Changelog
| Version | Description |
|---|---|
| 5.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/is_site_meta_supported