Created
January 9, 2018 19:16
-
-
Save djrmom/f4d9542436a56f3122729721712bf0bb to your computer and use it in GitHub Desktop.
facetwp facetwp_query_args shortcode template filter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'facetwp_query_args', function( $query_args, $class ) { | |
if ( 'gluten_free' == $class->ajax_params['template'] && 'gluten-free-everywhere' == $class->http_params['uri'] ) { | |
$query_args['tax_query'] = array( | |
array( | |
'taxonomy' => 'category', // change 'category' to different taxonomy if needed | |
'field' => 'slug', | |
'terms' => array( 'entertainment', 'travel', 'breakfast-box', 'lunchbox', 'gluten-free-guides' ) // array of term slugs | |
) | |
); | |
} | |
return $query_args; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment