[wp-trac] [WordPress Trac] #18311: Support HTML in image captions.

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 9 18:15:15 UTC 2012


#18311: Support HTML in image captions.
--------------------------------------------------+-----------------------
 Reporter:  prettyboymp                           |       Owner:  sushkov
     Type:  task (blessed)                        |      Status:  assigned
 Priority:  normal                                |   Milestone:  3.4
Component:  General                               |     Version:
 Severity:  normal                                |  Resolution:
 Keywords:  needs-patch ux-feedback dev-feedback  |
--------------------------------------------------+-----------------------

Comment (by jeremyclarke):

 Replying to [comment:20 jane]:
 > Replying to [comment:19 DrewAPicture]:
 > > Right, but you should still be able to edit the metadata (including
 the caption) even if it's just an archive.
 > Maybe maybe not. If the metadata is use-specific, not file-specific,
 that would not be true. Linking to the use-specific editor makes sense,
 but say you have a logo or a headshot of someone that you caption
 differently every week. The file archive should have the single headshot,
 not hundreds of captions you have to wade through to find a file.


 Chiming in on this relatively old question, it's worth parsing out what
 each of these fields is used for in interpreting their relevance.

 The caption is in fact used beyond the insertion of images into posts. At
 least in twenty-ten and twenty-eleven, if you use the [gallery] shortcode
 then on the thumbnail-list of images the text below each image is the
 caption as saved in the metadata. The caption is also used (albeit a bit
 strangely) on the single-image page when you click the thumbnail, between
 the image and the 'description' which is shown below.

 Notably, any subsequent insertions of the image into that [gallery] post
 or in fact any other post (using the 'media library' tab in the uploader
 of other posts), will overwrite the caption text on the image, and thus
 change the behavior of the gallery. So if you carefully assemble a
 [gallery] with useful captions for each image in the context of the
 gallery then you need to never edit any of the captions on those images in
 the future or your gallery will become confusing. I actually didn't know
 that it would do this. I thought that the captions wouldn't be used in
 [gallery] but tested to make sure, glad I did!

 To me the captions SHOULD be transient and insertion-specific, as Jane
 described. It's a logical thing to expect, especially compared to the
 'description' and 'title' fields, which make much more sense as being
 official and linked to the image rather than the use. I'm pretty sure that
 the Link option actually does work like this, and isn't used anywhere
 other than in image insertions that happen while that link is visible in
 the field.

 Despite what I might want though, captions are in fact a permanent part of
 each image attachment and thus on some level (at least for anyone who uses
 [gallery]) should be treated as directly linked with the image and
 permanent.

 All that said, it doesn't really affect this ticket significantly unless
 we're seriously considering using the db-stored metadata to generate the
 [caption] shortcode at load time. As long as we stick with the current
 paradigm where the caption metadata parts ways with the caption text for a
 particular insertion at insertion time then we are fine. As an example, we
 should think about [gallery] and the stuff above if we are considering
 making the Visual Editor image settings editor capapable of editing the
 db-based metadata.

 WHOOSH. I'm going to test the actual patch now.

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


More information about the wp-trac mailing list