woocommerce_disable_rest_api_access_log
This filter enables the exclusion of the most recent access time from being logged for REST API calls.
Usage
add_filter( 'woocommerce_disable_rest_api_access_log', 'wp_kama_woocommerce_disable_rest_api_access_log_filter', 10, 3 );
/**
* Function for `woocommerce_disable_rest_api_access_log` filter-hook.
*
* @param bool $result Default value.
* @param int $key_id Key ID associated with REST API request.
* @param int $user_id User ID associated with REST API request.
*
* @return bool
*/
function wp_kama_woocommerce_disable_rest_api_access_log_filter( $result, $key_id, $user_id ){
// filter...
return $result;
}
- $result(true|false)
- Default value.
- $key_id(int)
- Key ID associated with REST API request.
- $user_id(int)
- User ID associated with REST API request.
Changelog
| Since 7.7.0 | Introduced. |
Where the hook is called
woocommerce_disable_rest_api_access_log
woocommerce/includes/class-wc-rest-authentication.php 643
if ( apply_filters( 'woocommerce_disable_rest_api_access_log', $do_not_record, $this->user->key_id, $this->user->user_id ) ) {