Front-end Editor compat
-
Hi,
I’m working on the Front-end Editor feature plugin.
https://make.www.ads-software.com/ui/tag/front-end-editor/I noticed that you include a caption and description with the feature image.
$caption = get_post(get_post_thumbnail_id())->post_excerpt; $description = get_post(get_post_thumbnail_id())->post_content;
Since we manipulate the functions so that featured images areas are displayed, even if there is none, the theme tries to get the caption an description of
get_post_thumbnail_id( true )
. Which will either return the first post or throw notices when ‘Trying to get property of non-object’.Could you add some additional checks to make sure
get_post()
returns an object?Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Front-end Editor compat’ is closed to new replies.