woocommerce_analytics_customer_roles
Filter the customer roles, used to check if the user is a customer.
Usage
add_filter( 'woocommerce_analytics_customer_roles', 'wp_kama_woocommerce_analytics_customer_roles_filter' );
/**
* Function for `woocommerce_analytics_customer_roles` filter-hook.
*
* @param array $array List of customer roles.
*
* @return array
*/
function wp_kama_woocommerce_analytics_customer_roles_filter( $array ){
// filter...
return $array;
}
- $array(array)
- List of customer roles.
Changelog
| Since 4.0.0 | Introduced. |
Where the hook is called
woocommerce_analytics_customer_roles
woocommerce/src/Admin/API/Reports/Customers/DataStore.php 962
$customer_roles = (array) apply_filters( 'woocommerce_analytics_customer_roles', array( 'customer' ) );