Ticket #23151: 23151.patch
| File 23151.patch, 976 bytes (added by , 13 years ago) |
|---|
-
wp-includes/template.php
315 315 function get_attachment_template() { 316 316 global $posts; 317 317 318 $templates = array(); 319 318 320 if ( ! empty( $posts ) && isset( $posts[0]->post_mime_type ) ) { 319 321 $type = explode( '/', $posts[0]->post_mime_type ); 320 322 321 323 if ( ! empty( $type ) ) { 322 if ( $template = get_query_template( $type[0] ) ) 323 return $template; 324 elseif ( $template = get_query_template( $type[1] ) ) 325 return $template; 326 elseif ( $template = get_query_template( "$type[0]_$type[1]" ) ) 327 return $template; 324 $templates[] = "$type[0].php"; 325 $templates[] = "$type[1].php"; 326 $templates[] = "$type[0]_$type[1].php"; 328 327 } 329 328 } 330 329 331 return get_query_template( 'attachment' ); 330 $templates[] = 'attachment.php'; 331 332 return get_query_template( 'attachment', $templates ); 332 333 } 333 334 334 335 /**