Automattic\WooCommerce\Blocks\Shipping
PickupLocationsRestController::update_settings_permissions_check
Check whether the current user can update pickup location settings.
Method of the class: PickupLocationsRestController{}
No Hooks.
Returns
true|\WP_Error.
Usage
$PickupLocationsRestController = new PickupLocationsRestController(); $PickupLocationsRestController->update_settings_permissions_check( $request );
- $request(required)
- .
PickupLocationsRestController::update_settings_permissions_check() PickupLocationsRestController::update settings permissions check code WC 11.3.0
public function update_settings_permissions_check( $request ) {
if ( ! wc_rest_check_manager_permissions( 'settings', 'edit' ) ) {
return new \WP_Error(
'woocommerce_rest_cannot_edit',
__( 'Sorry, you cannot edit this resource.', 'woocommerce' ),
array( 'status' => rest_authorization_required_code() )
);
}
return true;
}