woocommerce_api_check_authentication хук-фильтрWC 2.1

Check authentication for the request

Использование

add_filter( 'woocommerce_api_check_authentication', 'wp_kama_woocommerce_api_check_authentication_filter', 10, 2 );

/**
 * Function for `woocommerce_api_check_authentication` filter-hook.
 * 
 * @param  $null 
 * @param  $that 
 *
 * @return 
 */
function wp_kama_woocommerce_api_check_authentication_filter( $null, $that ){

	// filter...
	return $null;
}
$null
-
$that
-

Список изменений

С версии 2.1 Введена.

Где вызывается хук

WC_API_Server::check_authentication()
woocommerce_api_check_authentication
woocommerce/includes/legacy/api/v3/class-wc-api-server.php 154
$user = apply_filters( 'woocommerce_api_check_authentication', null, $this );
woocommerce/includes/legacy/api/v2/class-wc-api-server.php 154
$user = apply_filters( 'woocommerce_api_check_authentication', null, $this );
woocommerce/includes/legacy/api/v1/class-wc-api-server.php 161
$user = apply_filters( 'woocommerce_api_check_authentication', null, $this );

Где используется хук в WooCommerce

woocommerce/includes/legacy/api/v1/class-wc-api-authentication.php 26
add_filter( 'woocommerce_api_check_authentication', array( $this, 'authenticate' ), 0 );
woocommerce/includes/legacy/api/v2/class-wc-api-authentication.php 26
add_filter( 'woocommerce_api_check_authentication', array( $this, 'authenticate' ), 0 );
woocommerce/includes/legacy/api/v3/class-wc-api-authentication.php 26
add_filter( 'woocommerce_api_check_authentication', array( $this, 'authenticate' ), 0 );