Any way to remove post__in when filtering results?
-
Here is my problem:
When the page loads, I preload 7 specific posts using the post__in attribute (using the ajax load more shortcode). However, when the user applies a filter, I need to remove post__in, or set it to empty (so that all posts matching that filter will be queried, and not just the 7 that were preloaded).
In WP_QUERY an empty post__in argument will be ignored, but in Ajax Load More Filtering, the empty post__in argument passed via data-post-in is considered to be “unset” which means the filter will be ignored, and the post__in won’t update to empty.
Thus, I can’t set post__in to empty via the data-post-in attribute. I tried passing a “space” over, hoping that the plugin code would trim it, and then the query would ignore it, but that’s not the case.
- The topic ‘Any way to remove post__in when filtering results?’ is closed to new replies.