WC_REST_Customers_V1_Controller::create_item_permissions_check()
Check if a given request has access create customers.
Method of the class: WC_REST_Customers_V1_Controller{}
No Hooks.
Return
true|false|WP_Error
.
Usage
$WC_REST_Customers_V1_Controller = new WC_REST_Customers_V1_Controller(); $WC_REST_Customers_V1_Controller->create_item_permissions_check( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
WC_REST_Customers_V1_Controller::create_item_permissions_check() WC REST Customers V1 Controller::create item permissions check code WC 9.7.1
public function create_item_permissions_check( $request ) { if ( ! wc_rest_check_user_permissions( 'create' ) ) { return new WP_Error( 'woocommerce_rest_cannot_create', __( 'Sorry, you are not allowed to create resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); } return true; }