Ticket #18311: 18311.php.diff
File 18311.php.diff, 792 bytes (added by , 12 years ago) |
---|
-
wp-includes/media.php
724 724 * @return string 725 725 */ 726 726 function img_caption_shortcode($attr, $content = null) { 727 // New-style shortcode with the caption inside the shortcode with the link and image tags. 728 if ( ! isset( $attr['caption'] ) ) { 729 preg_match( '#(<a\s.*?<img\s.*?</a>)(.*)#is', $content, $matches ) || preg_match( '#(<img\s.*?>)(.*)#is', $content, $matches ); 730 if ( $matches ) { 731 $content = $matches[1]; 732 $attr['caption'] = trim( $matches[2] ); 733 } 734 } 727 735 728 736 // Allow plugins/themes to override the default caption template. 729 737 $output = apply_filters('img_caption_shortcode', '', $attr, $content);