is_search was called incorrectly
-
On every admin page this gets logged (I removed the full paths):
[31-Oct-2016 09:05:35 UTC] PHP Notice: is_search was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.1.) in wp-includes/functions.php on line 3897 [31-Oct-2016 09:05:35 UTC] PHP Notice: is_search was called <strong>incorrectly</strong>. Conditional query tags do not work before the query is run. Before then, they always return false. Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information. (This message was added in version 3.1.) in wp-includes/functions.php on line 3897 [31-Oct-2016 09:05:35 UTC] PHP Notice: Trying to get property of non-object in plugins/relevanssi/lib/search.php on line 23When looking at the
relevanssi_queryfunction I can see there are some things off (e.g. the above mentionedis_search()). Generally I think this function should be refactored, e.g.* return early if search is not activated for admin
* use the passed$queryobject instead of referencing the global objectI’d be happy to contribute an updated version of the function, if you accept pull requests (or similar).
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘is_search was called incorrectly’ is closed to new replies.