I recently installed the bonpress theme and am having trouble with the captions showing correctly. The more I try to understand how captions are supposed to work in Wordpress, the more I suspect something is not happening right with my installation.
When creating a post and inserting an image with a caption, Wordpress creates the following shortcode:
[caption id="attachment_40" align="alignleft" width="1024"]<a href="http://wordpress.local/wp-content/uploads/2012/10/2012-10-30-11.38.36.jpg"><img class="size-large wp-image-40" title="Torn motorcycle cover" src="http://wordpress.local/wp-content/uploads/2012/10/2012-10-30-11.38.36-e1351653272372-1024x984.jpg" alt="" width="1024" height="984" /></a> That's what I get for only spending $15 on a motorcycle cover[/caption]
As I read through several pages such as the first example here and the sample code here (used by bonpress), it appears as though the caption should be passed as an attribute, e.g.:
[caption id="attachment_40" align="alignleft" width="1024" caption="That's what I get for only spending $15 on a motorcycle cover"]<a href="http://wordpress.local/wp-content/uploads/2012/10/2012-10-30-11.38.36.jpg"><img class="size-large wp-image-40" title="Torn motorcycle cover" src="http://wordpress.local/wp-content/uploads/2012/10/2012-10-30-11.38.36-e1351653272372-1024x984.jpg" alt="" width="1024" height="984" /></a>[/caption]
If I manually enter the shortcode with caption
as an attribute, it renders correctly. Is something broken in my install that makes it so it doesn't build it this way?
Update: The caption shortcode is constructed by image_add_caption
in /wp-admin/includes/media.php (line 134 in WP 3.4.2). The shortcodes are being constructed properly according to this code, so this leaves me wondering why all the code I can find regarding the customization of img_caption_shortcode
filter assumes the caption is an attribute?