Trying to get property ‘ID’ of non-object
-
Hi there – great plugin, so a big thank you. I hope this is a helpful piece of feedback…
Previously, an issue was raised about Trying to get property ‘ID’ of non-object. I have stumbled across the same issue, but only in a specific situation…
I’m seeing the following (with debug mode on), but only when looking at a backend admin page for the Pods plugin. The first four errors relate to the Slide Anything plugin, and the fifth one points at the GeneratePress theme.
Notice: Trying to get property 'ID' of non-object in /Users/Michael/mampsites/ks-demo5/wp-content/plugins/slide-anything/php/slide-anything-admin.php on line 437 Notice: Trying to get property 'ID' of non-object in /Users/Michael/mampsites/ks-demo5/wp-content/plugins/slide-anything/php/slide-anything-admin.php on line 438 Notice: Trying to get property 'ID' of non-object in /Users/Michael/mampsites/ks-demo5/wp-content/plugins/slide-anything/php/slide-anything-admin.php on line 439 Notice: Trying to get property 'ID' of non-object in /Users/Michael/mampsites/ks-demo5/wp-content/plugins/slide-anything/php/slide-anything-admin.php on line 440 Notice: Trying to get property 'ID' of non-object in /Users/Michael/mampsites/ks-demo5/wp-content/themes/generatepress/inc/meta-box.php on line 52
Here are the corresponding lines of code:
$info_added = get_post_meta($post->ID, 'sa_info_added', true); $info_deleted = get_post_meta($post->ID, 'sa_info_deleted', true); $info_duplicated = get_post_meta($post->ID, 'sa_info_duplicated', true); $info_moved = get_post_meta($post->ID, 'sa_info_moved', true); if ( $blog_id && (int) $blog_id === (int) $post->ID ) {
I raised this with GeneratePress and they’ve agreed it needs a fix.
Perhaps this is something that could be looked at again?
- The topic ‘Trying to get property ‘ID’ of non-object’ is closed to new replies.