Action
rpress_api_output_after
On this page
Fires after the API response has been rendered.
Runs in RPRESS_API::output() after the response has been printed in the selected format and immediately before rpress_die() ends the request. Use it for cleanup or logging.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$arg1 | array | The response data that was output. |
$this | RPRESS_API | The API instance. |
$format | string | The output format that was used. |
Example#
function my_api_after_output( $data, $api, $format ) {
error_log( sprintf( 'RestroPress API response sent as %s', $format ) );
}
add_action( 'rpress_api_output_after', 'my_api_after_output', 10, 3 );
Source#
Fired from:
includes/api/class-rpress-api.php(line 1526), inRPRESS_API::output()includes/class-rpress-api.php(line 1127), inRPRESS_API::output()
See also#
Was this page helpful?
