Convert search criteria into a filter #126
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ran into a problem with my site, which after a couple of hours searching i tracked down to how this plugin worked in combination with another plugin. It appears the other plugin (which i will ask for a fix as well), does some queries in the pre_get_posts, which screws up this plugin.
Basically what happens is that a plugin does some queries in the pre_get_posts to determine if it should do something. These queries do appear to be the main_query, even though they are not. I guess you ran into somewhat similair problems (looking at the attempted variable).
So to allow other people with similair problems to correct this i introduced this filter. Basically you will get one filter per search type. So you should get:
People can then add their own criteria (or remove the default ones) when needed.
If you have some alternative solution i could not think of, which will not require this pull request, please let me know!