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.

Method of the class: WP_Super_Cache_Rest_Update_Settings{}

No Hooks.

Return

null. Nothing (null).

Usage

// protected - for code of main (parent) or child class
$result = $this->set_global( $global_name, $value );
$global_name(string) (required)
-
$value(mixed) (required)
-

WP_Super_Cache_Rest_Update_Settings::set_global() code 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 );
}