- This topic has 1 reply, 2 voices, and was last updated 7 years, 5 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › sf_edit_query_args not working with post__in
I’m having problems filtering sf_edit_query_args with the post__in query arg. Here’s a quick prototype that I have:
add_filter( 'sf_edit_query_args', function( $query_args, $sfid ) {
if ( 20205 === $sfid ) {
$query_args['post__in'] = array( 20696, 20694, 20612 );
}
return $query_args;
}, 20, 2 );
I double-checked that 20205 is the id of the search&filter form and that 20696, 20694, 20612 are actual custom post type ids. The form works as it should with the usual search&filter search field, custom post type filters, tag dropdowns, etc. But I’m not able to filter it programmatically with the provided post ids (however, it works correctly with a provided custom post type – $query_args['post_type'] = 'custom';). It simply returns no results. Is the post__in query arg not supported?
Thanks!