WP_Super_Cache_Rest_Update_Settings::save_preload_settings()protectedWPSCache 1.0

Runs at the end and saves the preload settings.

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->save_preload_settings();

WP_Super_Cache_Rest_Update_Settings::save_preload_settings() code WPSCache 1.12.0

protected function save_preload_settings() {
	if ( ! isset( $_POST['_preload_setting'] ) || true !== $_POST['_preload_setting'] ) {
		return;
	}

	$_POST['action'] = 'preload';

	$all_preload_settings = array(
		'preload_interval'     => 'wp_cache_preload_interval',
		'preload_on'           => 'wp_cache_preload_on',
		'preload_taxonomies'   => 'wp_cache_preload_taxonomies',
		'preload_email_volume' => 'wp_cache_preload_email_volume',
		'preload_posts'        => 'wp_cache_preload_posts',
	);

	foreach ( $all_preload_settings as $key => $original ) {
		if ( ! isset( $_POST[ $key ] ) ) {
			$_POST[ $original ] = $GLOBALS[ $original ];
		} else {
			$_POST[ $original ] = $_POST[ $key ];
			if ( $key !== 'preload_interval' && ( $_POST[ $key ] === 0 || $_POST[ $key ] === false ) ) {
				unset( $_POST[ $original ] );
			}

		}
	}

	wpsc_preload_settings();
}