Changeset 23843 for trunk/wp-includes/post-formats.php
- Timestamp:
- 03/29/2013 03:35:41 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post-formats.php
r23836 r23843 85 85 'quote_source' => '', 86 86 'url' => '', 87 'media' => '', 87 'image' => '', 88 'gallery' => '', 89 'audio' => '', 90 'video' => '', 88 91 ); 89 92 … … 352 355 case 'video': 353 356 case 'audio': 354 if ( ! has_shortcode( $post->post_content, $format ) && ! empty( $meta['media'] ) ) { 357 if ( ! has_shortcode( $post->post_content, $format ) && ! empty( $meta[$format] ) ) { 358 // the metadata is an attachment ID 359 if ( is_numeric( $meta[$format] ) ) { 360 $url = wp_get_attachment_url( $meta[$format] ); 361 $format_output .= sprintf( '[%s src="%s"]', $format, $url ); 355 362 // the metadata is a shortcode or an embed code 356 if ( preg_match( '/' . get_shortcode_regex() . '/s', $meta['media'] ) || preg_match( '#<[^>]+>#', $meta['media'] ) ) {357 $format_output .= $meta[ 'media'];358 } elseif ( ! stristr( $content, $meta[ 'media'] ) ) {363 } elseif ( preg_match( '/' . get_shortcode_regex() . '/s', $meta[$format] ) || preg_match( '#<[^>]+>#', $meta[$format] ) ) { 364 $format_output .= $meta[$format]; 365 } elseif ( ! stristr( $content, $meta[$format] ) ) { 359 366 // attempt to embed the URL 360 $format_output .= sprintf( '[embed]%s[/embed]', $meta[ 'media'] );367 $format_output .= sprintf( '[embed]%s[/embed]', $meta[$format] ); 361 368 } 362 369 }
Note: See TracChangeset
for help on using the changeset viewer.