WP_Super_Cache_Rest_Update_Settings::save_time_settings()
Runs at the end and saves the time 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_time_settings( $parameters );
- $parameters (required)
- -
WP_Super_Cache_Rest_Update_Settings::save_time_settings() WP Super Cache Rest Update Settings::save time settings code WPSCache 1.12.4
protected function save_time_settings( $parameters ) { if ( ! isset( $_POST['_time_setting'] ) || true !== $_POST['_time_setting'] ) { return; } $_POST['action'] = 'expirytime'; $all_time_settings = array( 'cache_max_time', 'cache_schedule_type', 'cache_scheduled_time', 'cache_schedule_interval', 'cache_time_interval', 'cache_gc_email_me' ); foreach ( $all_time_settings as $time_setting ) { if ( false == isset( $_POST[ $time_setting ] ) || $GLOBALS[ $time_setting ] == $_POST[ $time_setting ] ) { $_POST[ $time_setting ] = $GLOBALS[ $time_setting ]; // fill in the potentially missing fields before updating GC settings. } } if ( isset( $parameters['cache_gc_email_me'] ) && $parameters['cache_gc_email_me'] == 0 ) { unset( $_POST['cache_gc_email_me'] ); } $_POST[ 'wp_max_time' ] = $_POST[ 'cache_max_time' ]; wp_cache_time_update(); }