Skip to content

Instantly share code, notes, and snippets.

@stas
Created February 15, 2012 21:38
Show Gist options
  • Save stas/1839162 to your computer and use it in GitHub Desktop.
Save stas/1839162 to your computer and use it in GitHub Desktop.
diff --git a/wp-includes/media.php b/wp-includes/media.php
index e3b9008..2f0a586 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -743,12 +743,20 @@ function img_caption_shortcode($attr, $content = null) {
if ( $id ) $id = 'id="' . esc_attr($id) . '" ';
return '<div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px">'
- . do_shortcode( $content ) . '<p class="wp-caption-text">' . $caption . '</p></div>';
+ . do_shortcode( $content ) . '<p class="wp-caption-text">' . do_shortcode( $caption ) . '</p></div>';
}
add_shortcode('gallery', 'gallery_shortcode');
/**
+ * Here goes new caption text handler
+ */
+function img_caption_shortcode_text( $attr, $content) {
+ return $content;
+}
+add_shortcode( 'caption_text', 'img_caption_shortcode_text' );
+
+/**
* The Gallery shortcode.
*
* This implements the functionality of the Gallery Shortcode for displaying
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment