Skip to content
Docs
Get RestroPress

Action

rpress_api_output_after

Updated
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#

ParameterTypeDescription
$arg1arrayThe response data that was output.
$thisRPRESS_APIThe API instance.
$formatstringThe 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), in RPRESS_API::output()
  • includes/class-rpress-api.php (line 1127), in RPRESS_API::output()

See also#

Was this page helpful?