Automattic\WooCommerce\StoreApi
Authentication::init
Hook into WP lifecycle events. This is hooked by the StoreAPI class on rest_api_init.
Метод класса: Authentication{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Authentication = new Authentication(); $Authentication->init();
Код Authentication::init() Authentication::init WC 10.4.2
public function init() {
if ( ! $this->is_request_to_store_api() ) {
return;
}
add_filter( 'rest_authentication_errors', array( $this, 'check_authentication' ) );
add_filter( 'rest_authentication_errors', array( $this, 'opt_in_checkout_endpoint' ), 9, 1 );
add_action( 'set_logged_in_cookie', array( $this, 'set_logged_in_cookie' ) );
add_filter( 'rest_pre_serve_request', array( $this, 'send_cors_headers' ), 10, 4 );
add_filter( 'rest_allowed_cors_headers', array( $this, 'allowed_cors_headers' ) );
add_filter( 'rest_exposed_cors_headers', array( $this, 'exposed_cors_headers' ) );
// Remove the default CORS headers--we will add our own.
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
}