I'm developing a client website with Wordpress (3.3) but have found that the image caption feature strips out any HTML tags.
The resulting caption is plain text which makes proper image crediting difficult. Also being a client website, WYSIWYG editing is required.
For example if my shortcode is:
[caption caption="This is my <em>example</em> caption"]
<a href="http://example.com/image.jpg">
<img src="http://example.com/image-300x224.jpg" alt=""/>
</a>
[/caption]
The tags are stripped from the caption attribute like so:
[caption caption="This is my example caption"]
<a href="http://example.com/image.jpg">
<img src="http://example.com/image-300x224.jpg" alt=""/>
</a>
[/caption]
The tags I'd most like to preserve are <em>
, <sup>
, <sub>
, <span>
and <a>
.
I haven't found any existing plugins to fix this except for links.
Any ideas on how to go about this and which functions to override?
<figure>
tags.