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 9.5.1
public function init() { if ( ! $this->is_request_to_store_api() ) { return; } add_filter( 'rest_authentication_errors', array( $this, 'check_authentication' ) ); add_action( 'set_logged_in_cookie', array( $this, 'set_logged_in_cookie' ) ); add_filter( 'rest_pre_serve_request', array( $this, 'send_cors_headers' ), 10, 3 ); add_filter( 'rest_allowed_cors_headers', array( $this, 'allowed_cors_headers' ) ); // Remove the default CORS headers--we will add our own. remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); }