Rename wp_caption shortcode to caption. Allow themes to disable captioning. Use dashes instead of underscores in class names. Props azaozz. see #6812

git-svn-id: https://develop.svn.wordpress.org/trunk@8313 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2008-07-11 15:59:14 +00:00
parent b3a7cce6ed
commit afd113dcf2
11 changed files with 78 additions and 37 deletions

View File

@@ -351,9 +351,13 @@ function wp_get_attachment_image($attachment_id, $size='thumbnail', $icon = fals
}
add_shortcode('wp_caption', 'img_caption_shortcode');
add_shortcode('caption', 'img_caption_shortcode');
function img_caption_shortcode($attr, $content = null) {
if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )
return $content;
// Allow plugins/themes to override the default caption template.
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
if ( $output != '' )