add customer role filter to customer data store

This commit is contained in:
Ron Rennick 2019-05-14 16:04:31 -03:00
parent 6780ae0136
commit bfd41fb577
1 changed files with 2 additions and 1 deletions

View File

@ -686,7 +686,8 @@ class WC_Admin_Reports_Customers_Data_Store extends WC_Admin_Reports_Data_Store
return false; return false;
} }
if ( $customer->get_order_count() < 1 && 'customer' !== $customer->get_role() ) { $customer_roles = (array) apply_filters( 'woocommerce_admin_customer_roles', array( 'customer' ) );
if ( $customer->get_order_count() < 1 && ! in_array( $customer->get_role(), $customer_roles, true ) ) {
return false; return false;
} }