• jnz31

    (@jnz31)


    php notice as shown above with a fix for the issue:
    in file simple-custom-post-order.php on 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.

    • This topic was modified 10 months ago by jnz31.
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.