WP_Super_Cache_Rest_Update_Settings::set_global() protected WPSCache 1.0
A generic method for setting globals.
The setting must be added to the whitelist in order to be set this way.
{} It's a method of the class: WP_Super_Cache_Rest_Update_Settings{}
No Hooks.
Return
Null. Nothing.
Usage
// protected - for code of main (parent) or child class $result = $this->set_global( $global_name, $value );
- $global_name(string) (required)
- $value(mixed) (required)
Code of WP_Super_Cache_Rest_Update_Settings::set_global() WP Super Cache Rest Update Settings::set global WPSCache 1.7.1
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 );
}