[wp-trac] [WordPress Trac] #27292: HTML5 Captions: Apply the filter img_caption_shortcode_width

WordPress Trac noreply at wordpress.org
Mon Mar 24 13:24:13 UTC 2014


#27292: HTML5 Captions: Apply the filter img_caption_shortcode_width
-------------------------+------------------------------
 Reporter:  jond3r       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Media        |     Version:  trunk
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:  template
-------------------------+------------------------------

Comment (by jond3r):

 Now that we are officially smashed by #26642 (that title was changed to
 'HTML5 captions', ouch!), we have to refocus this ticket to 'restore' the
 use of the {{{img_caption_shortcode_width}}} filter for the case when
 theme support has been added for HTML5 captions. The patch .3 makes this
 happen, together with a unit test.

 The use case of the filter is to make the inline width style of the figure
 element larger than the image width, in cases when the image width is
 narrow and/or the caption length is long.

 In the meantime we have to use the filter {{{img_caption_shortcode}}}, and
 reimplement most of the code in the {{{img_caption_shortcode()}}} function
 to accomplish this.

 As the {{{img_caption_shortcode_width}}} filter is not (yet) applied for
 the visual editor, the appearance in the editor will not accurately
 reflect the appearance on the front end, when the filter is used. It would
 be nice if we could improve the visual editor in this regard, presumably
 by some Ajax magic.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27292#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list