Ticket #24010: 24010.7.diff
File 24010.7.diff, 1.9 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/post-formats.php
26 26 <div id="image-preview" class="wp-format-media-preview"> 27 27 <?php 28 28 if ( is_numeric( $value ) ) { 29 $format_meta['image'] = absint( $value ); 30 $image = wp_get_attachment_url( $format_meta['image'] ); 31 printf( '<img src="%s" alt="%s" />', esc_url( $image ), get_the_title( $format_meta['image'] ) ); 29 $image = wp_get_attachment_url( $value ); 30 printf( '<img src="%s" alt="%s" />', esc_url( $image ), get_the_title( $value ) ); 32 31 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) { 33 32 echo do_shortcode( $value ); 34 33 } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) { … … 77 76 <div id="video-preview" class="wp-format-media-preview"> 78 77 <?php 79 78 if ( is_numeric( $value ) ) { 80 $ url= wp_get_attachment_url( $value );81 echo do_shortcode( sprintf( '[video src="%s"]', $ url) );79 $video = wp_get_attachment_url( $value ); 80 echo do_shortcode( sprintf( '[video src="%s"]', $video ) ); 82 81 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) { 83 82 echo do_shortcode( $value ); 84 83 } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) { … … 115 114 <div id="audio-preview" class="wp-format-media-preview"> 116 115 <?php 117 116 if ( is_numeric( $value ) ) { 118 $ url= wp_get_attachment_url( $value );119 echo do_shortcode( sprintf( '[audio src="%s"]', $ url) );117 $audio = wp_get_attachment_url( $value ); 118 echo do_shortcode( sprintf( '[audio src="%s"]', $audio ) ); 120 119 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $value ) ) { 121 120 echo do_shortcode( $value ); 122 121 } elseif ( ! preg_match( '#<[^>]+>#', $value ) ) {