WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18311, comment 38


Ignore:
Timestamp:
02/16/12 20:59:26 (4 years ago)
Author:
nacin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18311, comment 38

    initial v1  
    33We're screwed there either way, though. Once we nest the content into caption_text, we're backwards incompatible for callbacks expecting an attribute. 
    44 
    5 So, we need to figure out how to be compatible here. What we can do is make img_caption_shortcode() reach into $content, remove the caption, and add it into $attr['caption']. Then pass the modified $attr and $content into the filter. 
     5So, we need to figure out how to be compatible here. What we can do is make img_caption_shortcode() reach into $content, remove the caption, and add it into `$attr['caption']`. Then pass the modified $attr and $content into the filter. 
    66 
    77This would work best with a single [caption] shortcode, and no [caption_text]. The regex would need to account for <a> tags around the <img> tag as well.