Notice: Trying to get property of non-object
-
Hey Folks,
Loving the plugin, however I’ve just noticed this bug. I’m not the best on diagnostics, so forgive me if I’m doing something really stupidly obvious.
I’ve got a CPT with ACF fields in it. I’m using the ACF URL field to specify the link then using this code to output the card along with text from an ACF WYSIWYG.
<?php $url = get_field('signpost_url'); $text = get_field('signpost_text'); $card = "[contentcards target='_blank' url='$url']"; echo do_shortcode($card); echo $text; ?>
When I’m modifying, or adding a CPT I see this debug message:
Notice: Trying to get property of non-object in /Users/Peachey_A/Documents/Development/digi-champs.dev/wp-content/plugins/content-cards/content-cards.php on line 695
Then, on updating or publishing the CPT I get a white screen with these errors:
Notice: Trying to get property of non-object in /Users/Peachey_A/Documents/Development/digi-champs.dev/wp-content/plugins/content-cards/content-cards.php on line 695
Warning: Cannot modify header information – headers already sent by (output started at /Users/Peachey_A/Documents/Development/digi-champs.dev/wp-content/plugins/content-cards/content-cards.php:695) in /Users/Peachey_A/Documents/Development/digi-champs.dev/wp-admin/post.php on line 197
Warning: Cannot modify header information – headers already sent by (output started at /Users/Peachey_A/Documents/Development/digi-champs.dev/wp-content/plugins/content-cards/content-cards.php:695) in /Users/Peachey_A/Documents/Development/digi-champs.dev/wp-includes/pluggable.php on line 1167
I’m not sure if this is an ACF compatability issue. Or my error somewhere… Any thoughts would be awesome.
- The topic ‘Notice: Trying to get property of non-object’ is closed to new replies.