[wp-trac] [WordPress Trac] #14390: post image (thumbnail) in [gallery]

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 19 20:03:55 UTC 2010


#14390: post image (thumbnail) in [gallery]
-----------------------------+----------------------------------------------
 Reporter:  thomask          |       Owner:  nkuttler                            
     Type:  defect (bug)     |      Status:  accepted                            
 Priority:  normal           |   Milestone:  Awaiting Review                     
Component:  Post Thumbnails  |     Version:  3.0                                 
 Severity:  normal           |    Keywords:  has-patch, dev-feedback, ui-feedback
-----------------------------+----------------------------------------------

Comment(by coffee2code):

 I've attached 14390.diff with an alternative approach.  It simply sets the
 `get_post_thumbnail_id()` value as the shortcode's default 'exclude'
 value.

 The difference between @nkuttler's approach and this one is that
 @nkuttler's approach always excludes the post's thumbnail image whereas
 14390.diff only does so by default, but if the user specifies anything via
 the shortcode's "exclude" attribute, then the post thumbnail image is not
 excluded unless the user does so explicitly.

 My approach presumes that if the user is excluding at least one image,
 they will know enough to be able to exclude the post thumbnail as well.
 And if for some reason they'd like to include the post thumbnail image as
 part of the gallery, they can still do so.

 With the previous patch there would be no way to include the post
 thumbnail in the gallery (as @nkuttler also noted).

 This actually prompted me to work up a patch to allow filtering
 `shortcode_atts()` so that this could be done in a better, more
 customizable fashion (and not just for this shortcode).  See #15155 for an
 example.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14390#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list