Changeset 23843 for trunk/wp-includes/media.php
- Timestamp:
- 03/29/2013 03:35:41 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r23840 r23843 2044 2044 if ( has_post_format( $type ) ) { 2045 2045 $meta = get_post_format_meta( $post->ID ); 2046 if ( ! empty( $meta[ 'media'] ) ) {2047 if ( is_ numeric( $meta['media'] ) ) {2048 $url = wp_get_attachment_url( $meta[ 'media'] );2046 if ( ! empty( $meta[$type] ) ) { 2047 if ( is_integer( $meta[$type] ) ) { 2048 $url = wp_get_attachment_url( $meta[$type] ); 2049 2049 $shortcode = sprintf( '[%s src="%s"]', $type, $url ); 2050 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[ 'media'] ) ) {2051 $shortcode = $meta[ 'media'];2052 } elseif ( preg_match( '#<[^>]+>#', $meta[ 'media'] ) ) {2053 $post->format_content = $meta[ 'media'];2050 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[$type] ) ) { 2051 $shortcode = $meta[$type]; 2052 } elseif ( preg_match( '#<[^>]+>#', $meta[$type] ) ) { 2053 $post->format_content = $meta[$type]; 2054 2054 return $post->format_content; 2055 } elseif ( 0 === strpos( $meta[ 'media'], 'http' ) ) {2056 $post->split_content = str_replace( $meta[ 'media'], '', $post->post_content, $count );2057 if ( strstr( $meta[ 'media'], home_url() ) ) {2058 $shortcode = sprintf( '[%s src="%s"]', $type, $meta[ 'media'] );2055 } elseif ( 0 === strpos( $meta[$type], 'http' ) ) { 2056 $post->split_content = str_replace( $meta[$type], '', $post->post_content, $count ); 2057 if ( strstr( $meta[$type], home_url() ) ) { 2058 $shortcode = sprintf( '[%s src="%s"]', $type, $meta[$type] ); 2059 2059 } else { 2060 $post->format_content = $wp_embed->autoembed( $meta[ 'media'] );2060 $post->format_content = $wp_embed->autoembed( $meta[$type] ); 2061 2061 return $post->format_content; 2062 2062 }
Note: See TracChangeset
for help on using the changeset viewer.