Type
Filter
Arguments
(array) $response
(array) $args
(class) $api_object
Description
Allows filtering the API response by adding a custom response item on top of everything else.
Observation
The cache module need to be off for the filter to trigger.
Example of usage
Return additional response with a timestamp call, on top of the other API messages.
add_filter( 'WOOSL/API_call/early_response', 'WOOSL_API_call_early_response', 10, 3 ); function WOOSL_API_call_early_response ( $response, $args, $object ) { $response[] = array ( 'status' => 'success', 'timestamp' => time(), 'message' => 'API call time' ); return $response; }