php notice: Notice: Function is_search was called incorrectly.
-
php notice as shown above with a fix for the issue:
in filesimple-custom-post-order.phpon line 602:if ( is_search() ) {replace with
if ( $wp_query->is_search() ) {and while you at it, line 606:
if ( is_admin() && ! wp_doing_ajax() ) {replace with:
if ( $wp_query->is_admin() && ! wp_doing_ajax() ) {short explainer: you run is_search before the query has been run (inside
pre_get_posts…) but since you submit the query into the action anyhow, you simply need to check it on itself.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘php notice: Notice: Function is_search was called incorrectly.’ is closed to new replies.