[wp-hackers] Image caption shortcode format change

Jeff Tchang jeff.tchang at gmail.com
Tue Dec 17 05:04:45 UTC 2013


On Mon, Dec 16, 2013 at 8:15 PM, Andrew Ozz <admin at laptoptips.ca> wrote:

> On 16/12/2013 5:45 PM, Jeff Tchang wrote:
>
>> How about sticking a wp-caption class around the caption and wrapping it
>> in
>> a span tag?
>>
>
> Not really needed as the $html in
>
> `[caption ...]' . $html . ' ' . $caption . '[/caption]`
>
> is either an <img> or an <a><img></a> which can be extracted relatively
> easy. Here's the JS regex that does it in the editor:
> http://core.trac.wordpress.org/browser/trunk/src/wp-
> includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js#L143
>
>
Gotcha. I do find the regex rather difficult to understand though. Also it
seems cleaner to give it a class so people can target it via jquery and css.


More information about the wp-hackers mailing list