[wp-hackers] Image caption shortcode format change

Jeff Tchang jeff.tchang at gmail.com
Mon Dec 16 22:09:48 UTC 2013


I was recently implementing a python shortcode parser and adding support
for [caption] shortcodes.

I ran into a snafu in trying to determine if the caption shortcode format
had an attribute called "caption" as one of the parameters.

It turns out before this commit on May 2012 it did:

http://core.trac.wordpress.org/changeset/20679

This changeset removed the caption attribute. Around line 155 is what I am
talking about:


    $shcode = '[caption id="' . $id . '" align="align' . $align
     . '" width="' . $width . '" caption="' . $caption . '"]' . $html .
'[/caption]';

    $shcode = '[caption id="' . $id . '" align="align' . $align . '"
width="' . $width . '"]' . $html . ' ' . $caption . '[/caption]';

Was there a reason to remove the caption attribute? The shortcode becomes a
lot harder to parse dynamically.

-Jeff


More information about the wp-hackers mailing list