woocommerce_api_check_authentication

woocommerce_api_check_authentication

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_api_check_authentication') is found 3 times:

  • /includes/legacy/api/v1/class-wc-api-server.php line 161
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    */
    public function check_authentication() {
     
        // allow plugins to remove default authentication or add their own authentication
        $user = apply_filters( 'woocommerce_api_check_authentication', null, $this );
     
        // API requests run under the context of the authenticated user
        if ( is_a( $user, 'WP_User' ) ) {
            wp_set_current_user( $user->ID );
        } elseif ( ! is_wp_error( $user ) ) {
            // WP_Errors are handled in serve_request()
  • /includes/legacy/api/v2/class-wc-api-server.php line 154
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    */
    public function check_authentication() {
     
        // allow plugins to remove default authentication or add their own authentication
        $user = apply_filters( 'woocommerce_api_check_authentication', null, $this );
     
        if ( is_a( $user, 'WP_User' ) ) {
     
            // API requests run under the context of the authenticated user
            wp_set_current_user( $user->ID );
  • /includes/legacy/api/v3/class-wc-api-server.php line 154
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    */
    public function check_authentication() {
     
        // allow plugins to remove default authentication or add their own authentication
        $user = apply_filters( 'woocommerce_api_check_authentication', null, $this );
     
        if ( is_a( $user, 'WP_User' ) ) {
     
            // API requests run under the context of the authenticated user
            wp_set_current_user( $user->ID );

See this hook used in plugins: