Trying to get property of non-object notice
-
Getting these two notices:
PHP Notice: Trying to get property of non-object in /var/www/wordpress/wp-includes/post-template.php on line 298 PHP Notice: Undefined offset: 0 in /var/www/habitualmente.com/html/wp-content/plugins/easy-footnotes/easy-footnotes.php on line 72
This is the line within wp-includes/post-template.php that throws the notice:
if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) ) $strip_teaser = true;
Seems to be caused by
line 69
ineasy-footnotes.php
:preg_match_all( $pattern, get_the_content(get_the_ID()), $shortcodes );
$post
doesn’t seem to be set so thepost_content
doesn’t exists.The footnotes and counting still works properly. When I remove the line from the plugin I don’t get the notice anymore. Not sure why exactly it’s happening.
Best regards
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Trying to get property of non-object notice’ is closed to new replies.