Skip to content

Instantly share code, notes, and snippets.

@rmorse
Forked from dryan1144/filter-sf-pro-query.php
Last active January 7, 2024 03:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmorse/0d527a7a7821a5050254ed7ee0d279ff to your computer and use it in GitHub Desktop.
Save rmorse/0d527a7a7821a5050254ed7ee0d279ff to your computer and use it in GitHub Desktop.
This modifies the $query_args object (rather than replacing it, which removes all the settings that are already in the object created by S&F).
<?php
function hck_filter_taxonomy_archives( $query_args, $sfid ) {
if( $sfid == 509 ) {
$query_args['post_type'] = 'articles';
}
return $query_args;
}
add_filter( 'sf_edit_query_args', 'hck_filter_taxonomy_archives', 20, 2 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment