WC_REST_Shipping_Zones_Controller_Base::get_items_permissions_check()
Check whether a given request has permission to read Shipping Zones.
Метод класса: WC_REST_Shipping_Zones_Controller_Base{}
Хуков нет.
Возвращает
WP_Error|true|false
.
Использование
$WC_REST_Shipping_Zones_Controller_Base = new WC_REST_Shipping_Zones_Controller_Base(); $WC_REST_Shipping_Zones_Controller_Base->get_items_permissions_check( $request );
- $request(WP_REST_Request) (обязательный)
- Full details about the request.
Код WC_REST_Shipping_Zones_Controller_Base::get_items_permissions_check() WC REST Shipping Zones Controller Base::get items permissions check WC 9.3.1
public function get_items_permissions_check( $request ) { if ( ! wc_shipping_enabled() ) { return new WP_Error( 'rest_no_route', __( 'Shipping is disabled.', 'woocommerce' ), array( 'status' => 404 ) ); } if ( ! wc_rest_check_manager_permissions( 'settings', 'read' ) ) { return new WP_Error( 'woocommerce_rest_cannot_view', __( 'Sorry, you cannot list resources.', 'woocommerce' ), array( 'status' => rest_authorization_required_code() ) ); } return true; }