[wp-trac] [WordPress Trac] #24990: Nested Shortcode Inside [caption]

WordPress Trac noreply at wordpress.org
Mon May 11 10:29:11 UTC 2015


#24990: Nested Shortcode Inside [caption]
----------------------------------------+-----------------------------
 Reporter:  prionkor                    |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Media                       |     Version:  3.6
 Severity:  normal                      |  Resolution:
 Keywords:  needs-unit-tests has-patch  |     Focuses:
----------------------------------------+-----------------------------

Comment (by tychay):

 Replying to [comment:11 kitwestneat]:
 > I also ran into the "img tag replaced by shortcode" issue described in
 comment:10, and worked around it by filtering the regex with a new filter
 in media.php

 I think it's a good idea to add a filter here because a lot of people seem
 to be shunting the entire function with the `img_caption_shortcode`
 filter.

 However, I think it'd be more flexible to filter the `$matches` instead of
 just the preg, this way people can add onto the existing function, it'd be
 a little odd though, since you'd have to set $matches to false first and
 use that as the conditional. So who knows.

 As for the second part, a weirder side effect of that line is that when it
 fails because width=0, it ends up pruning the caption entirely! I wonder
 if [http://justintadlock.com/archives/2011/07/01/captions-in-wordpress
 Justin's article linked in the codex] will work now that a lot of oEmbed
 providers are dropping frames and <video> tags instead of image content?

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


More information about the wp-trac mailing list