WC_REST_Customers_V1_Controller::allowed_roles()
Returns list of allowed roles for the REST API.
Метод класса: WC_REST_Customers_V1_Controller{}
Хуки из метода
Возвращает
Массив
. $roles Allowed roles to be updated via the REST API.
Использование
// private - только в коде основоного (родительского) класса $result = $this->allowed_roles(): array;
Код WC_REST_Customers_V1_Controller::allowed_roles() WC REST Customers V1 Controller::allowed roles WC 9.6.1
private function allowed_roles(): array { /** * Filter the allowed roles for the REST API. * * Danger: Make sure that the roles listed here cannot manage the shop. * * @param array $roles Array of allowed roles. * * @since 9.5.2 */ return apply_filters( 'woocommerce_rest_customer_allowed_roles', array( 'customer', 'subscriber' ) ); }