woocommerce_rest_check_permissions

woocommerce_rest_check_permissions

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

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_rest_check_permissions') is found 5 times:

  • /includes/wc-rest-functions.php line 244
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
            $post_type_object = get_post_type_object( $post_type );
            $permission       = current_user_can( $post_type_object->cap->$cap, $object_id );
        }
     
        return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, $post_type );
    }
     
    /**
     * Check permissions of users on REST API.
     *
     * @since 2.6.0
  • /includes/wc-rest-functions.php line 282
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
        } else {
            $permission = current_user_can( $contexts[ $context ], $object_id );
        }
     
        return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, 'user' );
    }
     
    /**
     * Check permissions of product terms on REST API.
     *
     * @since 2.6.0
  • /includes/wc-rest-functions.php line 307
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
        $cap             = $contexts[ $context ];
        $taxonomy_object = get_taxonomy( $taxonomy );
        $permission      = current_user_can( $taxonomy_object->cap->$cap, $object_id );
     
        return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, $taxonomy );
    }
     
    /**
     * Check manager permissions on REST API.
     *
     * @since 2.6.0
  • /includes/wc-rest-functions.php line 331
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
        );
     
        $permission = current_user_can( $objects[ $object ] );
     
        return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, 0, $object );
    }
     
    /**
     * Check product reviews permissions on REST API.
     *
     * @since 3.5.0
  • /includes/wc-rest-functions.php line 364
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
        if ( isset( $contexts[ $context ] ) ) {
            $permission = current_user_can( $contexts[ $context ], $object_id );
        }
     
        return apply_filters( 'woocommerce_rest_check_permissions', $permission, $context, $object_id, 'product_review' );
    }
     
    /**
     * Returns true if the current REST request is from the product editor.
     *
     * @since 8.9.0

See this hook used in plugins: