WC_REST_Customers_V1_Controller::allowed_roles()
Returns list of allowed roles for the REST API.
Method of the class: WC_REST_Customers_V1_Controller{}
Hooks from the method
Return
Array
. $roles Allowed roles to be updated via the REST API.
Usage
// private - for code of main (parent) class only $result = $this->allowed_roles(): array;
WC_REST_Customers_V1_Controller::allowed_roles() WC REST Customers V1 Controller::allowed roles code WC 9.8.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' ) ); }