Automattic\WooCommerce\StoreApi
Authentication::check_authentication()
The Store API does not require authentication.
Метод класса: Authentication{}
Хуков нет.
Возвращает
\WP_Error|null|true|false
.
Использование
$Authentication = new Authentication(); $Authentication->check_authentication( $result );
- $result(\WP_Error|разное) (обязательный)
- Error from another authentication handler, null if we should handle it, or another value if not.
Код Authentication::check_authentication() Authentication::check authentication WC 7.5.1
public function check_authentication( $result ) { if ( ! $this->is_request_to_store_api() ) { return $result; } // Enable Rate Limiting for logged-in users without 'edit posts' capability. if ( ! current_user_can( 'edit_posts' ) ) { $result = $this->apply_rate_limiting( $result ); } // Pass through errors from other authentication methods used before this one. return ! empty( $result ) ? $result : true; }