Changeset 27622 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 03/19/2014 06:59:31 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/post-template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r27473 r27622 348 348 $classes[] = 'post-password-required'; 349 349 // Post thumbnails 350 } elseif ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {350 } elseif ( ! is_attachment( $post ) && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) { 351 351 $classes[] = 'has-post-thumbnail'; 352 352 } … … 1242 1242 return $content; 1243 1243 1244 $p = '<p class="attachment">'; 1245 // show the medium sized image representation of the attachment if available, and link to the raw file 1246 $p .= wp_get_attachment_link(0, 'medium', false); 1247 $p .= '</p>'; 1244 if ( wp_attachment_is_image() ): 1245 $p = '<p class="attachment">'; 1246 // show the medium sized image representation of the attachment if available, and link to the raw file 1247 $p .= wp_get_attachment_link(0, 'medium', false); 1248 $p .= '</p>'; 1249 elseif ( 0 === strpos( $post->post_mime_type, 'video' ) ): 1250 $meta = wp_get_attachment_metadata( get_the_ID() ); 1251 $atts = array( 'src' => wp_get_attachment_url() ); 1252 if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) { 1253 $atts['width'] = (int) $meta['width']; 1254 $atts['height'] = (int) $meta['height']; 1255 } 1256 $p = wp_video_shortcode( $atts ); 1257 elseif ( 0 === strpos( $post->post_mime_type, 'audio' ) ): 1258 $p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) ); 1259 endif; 1260 1248 1261 $p = apply_filters('prepend_attachment', $p); 1249 1262
Note: See TracChangeset
for help on using the changeset viewer.