I guess you don’t use the native WP query right? Because I am able to enable search by ID with the native search, but Ajax Search does not seem to make use of that. Can you tell me a snippet or something I could use to enable this please? It would really help me.
Nevermind, I posted this under the assumption it was one of my plugins with a similar name. I now see that is not the case.
Hi!
There is no option for that, but I guess I can suggest a plugin code modification.
Open up the wp-content\plugins\ajax-search-lite\includes\classes\search\search_content.class.php file and navigate to line 380, which should be an empty line. Put this code there:
$parts[] = "( " . $pre_field . $wpdb->posts . ".ID" . $suf_field . " = '" . $s . "' )";
Thank you very much.
Just another thing:any chance you can add this to you next update, maybe as an option?
If not, then is it at least possible to add the modification externally, e.g. as a hook, without modifying the plugin itself? I am asking because I normally want to use Code Snippets to add stuff without modifying so that it remains after the plugin is updated.
You are welcome!
I’ve recently implemented this option to the pro version, I think I will add it to this one as well.
I’m also planning to add better control over the final query via hooks to avoid these kinds of modifications.