Automattic\WooCommerce\StoreApi
Authentication::check_authentication
The Store API does not require authentication.
Method of the class: Authentication{}
No Hooks.
Returns
\WP_Error|null|true|false.
Usage
$Authentication = new Authentication(); $Authentication->check_authentication( $result );
- $result(WP_Error|mixed) (required)
- Error from another authentication handler, null if we should handle it, or another value if not.
Authentication::check_authentication() Authentication::check authentication code WC 10.7.0
public function check_authentication( $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;
}