Skip to content

Instantly share code, notes, and snippets.

@alaasalama
Created March 13, 2019 19:21
Show Gist options
  • Save alaasalama/6f8b1364e1100b2888f2b005891f3721 to your computer and use it in GitHub Desktop.
Save alaasalama/6f8b1364e1100b2888f2b005891f3721 to your computer and use it in GitHub Desktop.
Alter the shortcode logic to be AND instead of OR
/* Tribe, change tax query relation to AND instead of OR */
function tribe_list_widget_tax_query_relation ( $args ) {
    // bail if no relation is no tax query
    if ( !isset( $args['tax_query'] ) ) return $args;
    $args['tax_query']['relation'] = 'AND';
    return $args;
}
add_filter ( 'tribe_events_list_widget_query_args', 'tribe_list_widget_tax_query_relation', 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment