It still works, I just tested it. You probably have a conflicting plugin.
Ok, I tested it on an empty WordPress installation, and yes, it works, you are right, it must be a conflict. I have to test and deactivate each plugin to find the culprit. Thank you for replying!
No worries, I’m happy you came to the same conclusion π
Ok, it conflicts with “ACF: Better Search” plugin, that I am using to search in custom fields. Is there any way to make them both work? Thanks!
I could set a priority for the filter that modifies the search query, but that would most likely cause issues with other plugins that manipulates the query. Since searching by id isn’t exactly a vital feature I decided to not set a priority, so that other plugins that may be more important have a way to override.
There’s a chance ACF Better Search would break if I did that. If you want to, you can test it yourself. All you need to do is open search-by-id.php and alter line 16
from
add_filter('posts_where', array(&$this, 'posts_where'));
to
add_filter('posts_where', array(&$this, 'posts_where'), 999, 1);
999 is the priority (higher = more priority).
-
This reply was modified 2 years, 10 months ago by Uffe Fey.
Hi!
Thanks for your reply!
Unfortunately, it does not work. I still have to deactivate “ACF Better Search” to make it work, even after having replaced the php line.