PHP is_embed error showing up

admin2025-01-07  4

I can't seem to find what's causing the error to show up when I enabled the debug mode on my WordPress website that is installed locally.

Notice: is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /Applications/MAMP/htdocs/hostingfacts/wp-includes/functions.php on line 4139

Is this some plugin issue?

P.S. I'm using MAMP

I can't seem to find what's causing the error to show up when I enabled the debug mode on my WordPress website that is installed locally.

Notice: is_embed was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.) in /Applications/MAMP/htdocs/hostingfacts/wp-includes/functions.php on line 4139

Is this some plugin issue?

P.S. I'm using MAMP

Share Improve this question asked Sep 5, 2017 at 17:14 rolzanrolzan 11 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 1

The error itself is not because debug mode, it seems that the hook you're using is being called before the $wp_query is set.

what you can do is put inside your function

function your_error_function(){
        global $wp_query;
        if(! isset( $wp_query )){
          return 
        }
    ...rest of my code
}

or change the hook you're using to another that is called later, something like 'loop_start' should do.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736265123a1021.html

最新回复(0)