WordPress 3.4 and Captions.

Published in: Web Development.

WordPress 3.4 changed the shortcode syntax for image captions. This isn’t an issue for themes that don’t make any changes to the caption functionality or for themes that instituted the changes correctly.

Unfortunately, previous to this blog, I have been implementing complete overrides of the caption to output HTLM5 Figure/Figcaption code. This broke with the change to the core WordPress caption functionality. The fix just involves changing the custom caption function to use add_filter.1 When I developed the theme for this site, I found out the better way to do it. Read “Improved HTML5 WordPress Captions” here.2 I’m actually a little surprised they haven’t made the move to using Figure/Figcaption by default.

  1. Instead of, say, add_shortcode('wp_caption', 'function') and add_shortcode('caption', 'function') as I had been doing previously.
  2. Interestingly enough, that is one of the most frequently visited articles on this site.

Share:

Permalink:
http://writings.orangegnome.com/writes/wordpress-3-4-and-captions/
Shortlink:
http://lilgn.me/6g

Pingbacks:

Comments are disabled on this blog. If you have a thought, contact me on Twitter or on the contact form. If you have a really long thought, send me a link to your post about it.