Skip to content
Docs
Get RestroPress

Filter

rpress_api_log_requests

Updated
On this page

Filters whether API requests are logged.

Runs in RPRESS_API::log_requests(), which is checked before each API request is written to the logs. Return false to turn request logging off, for instance on high-traffic sites.

Parameters#

ParameterTypeDescription
$valueboolWhether logging is enabled; passed as true by default.

Return value#

bool. True to log API requests, false to skip logging.

Example#

function my_disable_api_request_logging( $log_requests ) {
	return false;
}
add_filter( 'rpress_api_log_requests', 'my_disable_api_request_logging', 10, 1 );

Source#

Applied in:

  • includes/api/class-rpress-api.php (line 1831), in RPRESS_API::log_requests()
  • includes/class-rpress-api.php (line 105), in RPRESS_API::__construct()
Was this page helpful?