wpsc_ajax_get_preload_status()WPSCache 1.0

Serves an AJAX endpoint to return the current state of the preload process.

No Hooks.

Returns

null. Nothing (null).

Usage

wpsc_ajax_get_preload_status();

wpsc_ajax_get_preload_status() code WPSCache 3.1.0

function wpsc_ajax_get_preload_status() {
	check_ajax_referer( 'wpsc-get-preload-status' );

	if ( ! current_user_can( 'manage_options' ) ) {
		wp_send_json_error( null, 403 );
	}

	$preload_status = wpsc_get_preload_status( true );
	wp_send_json_success( $preload_status, null, JSON_UNESCAPED_SLASHES );
}