You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PHP Notice: Trying to get property of non-object in /var/www/html/wp-content/plugins/broken-link-checker/includes/any-post.php on line 298
please fix
a lot of times this kind of notice can be fixed by isset() or property_exists() , however not sure if that would matter because $post is checked for emptiness first ( http://php.net/manual/en/function.empty.php ) . Maybe post is somehow not an object here.
if ( empty($post) || !in_array($post->post_type, $this->enabled_post_types)) {
Perhaps $post is not empty and $this is unset. That would lead to this condition. More careful checking of the nature of $this may be needed since this could be triggered in an odd place?
entering a debug statement, or var_dump($post) and var_dump($this) might be needed to figure this out.
Also need to know WP and PHP versions in play here.
The text was updated successfully, but these errors were encountered:
HongPong
changed the title
Notice: Trying to get property of non-object
Notice: Trying to get property of non-object in hook_the_content()
Mar 13, 2019
reported by @johnny538 a few months ago here
https://wordpress.org/support/topic/php-errors-135/
a lot of times this kind of notice can be fixed by isset() or property_exists() , however not sure if that would matter because $post is checked for emptiness first ( http://php.net/manual/en/function.empty.php ) . Maybe post is somehow not an object here.
see also https://wordpress.stackexchange.com/questions/88613/notice-trying-to-get-property-of-non-object-in-options-php
looks to me like this
Perhaps $post is not empty and $this is unset. That would lead to this condition. More careful checking of the nature of $this may be needed since this could be triggered in an odd place?
The text was updated successfully, but these errors were encountered: