woocommerce_analytics_customer_roles

woocommerce_analytics_customer_roles

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_analytics_customer_roles') is found 1 times:

  • /src/Admin/API/Reports/Customers/DataStore.php line 850
    		 *
    		 * @param array List of customer roles.
    		 * @since 4.0.0
    		 */
    		$customer_roles = (array) apply_filters( 'woocommerce_analytics_customer_roles', array( 'customer' ) );
    
    		if ( empty( $user->roles ) || empty( array_intersect( $user->roles, $customer_roles ) ) ) {
    			return false;
    		}
    
    		return true;