wpsc_update_idle_preload()WPSCache 1.0

Update the preload status to indicate it is idle. If a finish time is specified, store it.

Хуков нет.

Возвращает

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

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

wpsc_update_idle_preload( $finish_time );
$finish_time **
-
По умолчанию: null

Код wpsc_update_idle_preload() WPSCache 1.12.4

function wpsc_update_idle_preload( $finish_time = null ) {
	$preload_status = wpsc_get_preload_status();

	$preload_status['running'] = false;
	$preload_status['history'] = array();

	if ( ! empty( $finish_time ) ) {
		$preload_status['previous'] = $finish_time;
	}

	$filename = wpsc_get_preload_status_file_path();
	// phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_file_put_contents
	if ( false === file_put_contents( $filename, wp_json_encode( $preload_status ) ) ) {
		wp_cache_debug( "wpsc_update_idle_preload: failed to write to $filename" );
	}
}