/rest_api/callback

DescriptionDescription

This action is fired before the REST route proceeds the response callback.

It allows to bypasses the requested response.

ArgumentsArguments

ArgumentTypeDescription
$requestWP_REST_RequestGenerated request object
$paramsarrayHolds requested parameters

ExampleExample

PHP
functions.php
function prefix_rest_api_callback( $request, $params ) {

	// Return an earlier response.
	rest_ensure_response( [...] );

}

add_action( 'wp_grid_builder/rest_api/callback', 'prefix_rest_api_callback', 10, 2 );