W3cubDocs

/WordPress

global_terms_enabled()

Determine whether global terms are enabled.

Return

(bool) True if multisite and global terms enabled.

Source

File: wp-includes/functions.php

function global_terms_enabled() {
	if ( ! is_multisite() ) {
		return false;
	}

	static $global_terms = null;
	if ( is_null( $global_terms ) ) {

		/**
		 * Filters whether global terms are enabled.
		 *
		 * Returning a non-null value from the filter will effectively short-circuit the function
		 * and return the value of the 'global_terms_enabled' site option instead.
		 *
		 * @since 3.0.0
		 *
		 * @param null $enabled Whether global terms are enabled.
		 */
		$filter = apply_filters( 'global_terms_enabled', null );
		if ( ! is_null( $filter ) ) {
			$global_terms = (bool) $filter;
		} else {
			$global_terms = (bool) get_site_option( 'global_terms_enabled', false );
		}
	}
	return $global_terms;
}

Changelog

Version Description
3.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/global_terms_enabled