[wp-trac] [WordPress Trac] #18804: Add "has-post-thumbnail" class to post_class() when there's a featured image
WordPress Trac
noreply at wordpress.org
Sun Feb 9 23:50:04 UTC 2014
#18804: Add "has-post-thumbnail" class to post_class() when there's a featured
image
------------------------------+------------------------------
Reporter: danielbachhuber | Owner: danielbachhuber
Type: enhancement | Status: assigned
Priority: normal | Milestone: 3.9
Component: Post Thumbnails | Version: 2.9
Severity: normal | Resolution:
Keywords: has-patch commit | Focuses: template
------------------------------+------------------------------
Comment (by Compute):
What if the current theme includes this functionality? Then we would have
2 "post-thumbnail". While it does'nt break anything I would be alot nicer
if there was a check if this class is already represented.
Using {{{array_unique()}}} before the
{{{
return apply_filters('post_class', $classes, $class, $post->ID);
}}}
Might be even better.
Checking for {{{current_theme_supports()}}} would be smarter to use before
all this and maybe put this check into the {{{has_post_thumbnail()}}} or
{{{get_post_thumbnail_id()}}} instead of checking for this on every line
we use thumbnails.
Just 2 suggestions from my point of view :)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/18804#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list