WordPress at a glance
function is not described

WP_Super_Cache_Rest_Preload::callback() public WPSCache 1.0

Update the cache settings.

{} It's a method of the class: WP_Super_Cache_Rest_Preload{}

No Hooks.

Return

WP_Error/WP_REST_Response.

Usage

$WP_Super_Cache_Rest_Preload = new WP_Super_Cache_Rest_Preload();
$WP_Super_Cache_Rest_Preload->callback( $request );
$request(WP_REST_Request) (required)
Full data about the request.

Code of WP_Super_Cache_Rest_Preload::callback() WPSCache 1.7.1

<?php
public function callback( $request ) {
	$parameters = $request->get_json_params();

	if ( defined( 'DISABLESUPERCACHEPRELOADING' ) ) {
		wp_cache_debug( 'WP_Super_Cache_Rest_Preload: preload disabled by admin' );
		return rest_ensure_response( array( 'error' => 'preload disabled by admin' ) );
	}

	if ( isset( $parameters[ 'enable' ] ) ) {
		if ( $parameters[ 'enable' ] == true ) {
			wp_cache_debug( 'WP_Super_Cache_Rest_Preload: enable' );
			wpsc_enable_preload();
			return( rest_ensure_response( array( 'enabled' => true ) ) );
		} else {
			wp_cache_debug( 'WP_Super_Cache_Rest_Preload: cancel' );
			wpsc_cancel_preload();
			return( rest_ensure_response( array( 'enabled' => false ) ) );
		}
	}
}