public function filterTaxonomies($taxonomies, $type)
    {
        $passes = true;
        $tax_array = ($type == 0) ? get_field('event_filter_cat', 'options') : get_field('event_filter_tag', 'options');

        if (!empty($tax_array)) {
            $filters = array_map('trim', explode(',', $tax_array));
            $taxLower = array_map('strtolower', $taxonomies);
            $passes = false;

            foreach ($filters as $filter) {
                if (in_array(strtolower($filter), $taxLower)) {
                    $passes = true;
                }
            }
        }

        return $passes;
    }
public function filterTaxonomies($taxonomies, $type)
    {
        $passes = true;
        $tax_array = ($type == 0) ? get_field('event_filter_cat', 'options') : get_field('event_filter_tag', 'options');

        if (!empty($tax_array)) {
            $filters = array_map('trim', explode(',', $tax_array));
            $taxLower = array_map('strtolower', $taxonomies);
            $passes = false;

            foreach ($filters as $filter) {
                if (in_array(strtolower($filter), $taxLower)) {
                    $passes = true;
                }
            }
        }

        return $passes;
    }
public function filterTaxonomies ( $ taxonomies , $ type ) { $ passes = true ; $ tax_array = ( $ type == 0 ) ? get_field ( 'event_filter_cat' , 'options' ) : get_field ( 'event_filter_tag' , 'options' ) ; if ( ! empty ( $ tax_array ) ) { $ filters = array_map ( 'trim' , explode ( ',' , $ tax_array ) ) ; $ taxLower = array_map ( 'strtolower' , $ taxonomies ) ; $ passes = false ; foreach ( $ filters as $ filter ) { if ( in_array ( strtolower ( $ filter ) , $ taxLower ) ) { $ passes = true ; } } } return $ passes ; }
Filter by taxonomies, if add or not to add
@param  array $taxonomies All taxonomies
@param  int   $type       Type of taxonomy, 0 = category, 1 = tag
@return bool
Filter by taxonomies if add or not to add