woocommerce_disable_rest_api_access_log
This filter enables the exclusion of the most recent access time from being logged for REST API calls.
Использование
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.
Список изменений
С версии 7.7.0 | Введена. |
Где вызывается хук
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 ) ) {