woocommerce_analytics_customer_roles

woocommerce_analytics_customer_roles

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

See hook in core

Displaying hooks found in version: woocommerce.9.7.1

apply_filters('woocommerce_analytics_customer_roles') is found 1 times:

  • /src/Admin/API/Reports/Customers/DataStore.php line 863
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    *
     * @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;