WP_Super_Cache_Rest_Update_Settings::set_global()protectedWPSCache 1.0

A generic method for setting globals.

The setting must be added to the whitelist in order to be set this way.

Метод класса: WP_Super_Cache_Rest_Update_Settings{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->set_global( $global_name, $value );
$global_name(строка) (обязательный)
-
$value(разное) (обязательный)
-

Код WP_Super_Cache_Rest_Update_Settings::set_global() WPSCache 1.12.0

protected function set_global( $global_name, $value ) {
	$whitelist = array(
		'wp_super_cache_late_init',
		'wp_cache_disable_utf8',
		'wp_cache_no_cache_for_get',
		'wp_supercache_304',
		'wp_cache_mfunc_enabled',
		'wp_cache_mobile_enabled',
		'wp_cache_front_page_checks',
		'wp_supercache_cache_list',
		'wp_cache_hello_world',
		'wp_cache_clear_on_post_edit',
		'cache_rebuild_files',
		'wp_cache_refresh_single_only',
		'wp_cache_mutex_disabled',
		'wpsc_save_headers',
	);

	if ( ! in_array( $global_name, $whitelist ) ) {
		return false;
	}

	wp_cache_setting( $global_name, (int)$value );
}