WC_REST_Customers_V1_Controller::allowed_roles()privateWC 1.0

Returns list of allowed roles for the REST API.

Method of the class: WC_REST_Customers_V1_Controller{}

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() 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' ) );
}