Ticket #41564: 41564.2.diff
File 41564.2.diff, 1.3 KB (added by , 7 years ago) |
---|
-
src/wp-includes/template.php
113 113 114 114 if ( count( $post_types ) == 1 ) { 115 115 $post_type = reset( $post_types ); 116 117 // Look for post type template with hyphens. 118 if ( false !== strpos( $post_type, '_' ) ) { 119 $templates[] = 'archive-' . str_replace( '_', '-', $post_type ) . '.php'; 120 } 121 116 122 $templates[] = "archive-{$post_type}.php"; 117 123 } 118 124 $templates[] = 'archive.php'; … … 315 321 } 316 322 317 323 $templates[] = "taxonomy-$taxonomy-{$term->slug}.php"; 324 325 // Look for taxonomy template with hyphens. 326 if ( false !== strpos( $taxonomy, '_' ) ) { 327 $templates[] = 'taxonomy-' . str_replace( '_', '-', $taxonomy ) . '.php'; 328 } 329 318 330 $templates[] = "taxonomy-$taxonomy.php"; 319 331 } 320 332 $templates[] = 'taxonomy.php'; … … 495 507 } 496 508 497 509 $templates[] = "single-{$object->post_type}-{$object->post_name}.php"; 510 511 // Look for single template with hyphens. 512 if ( false !== strpos( $object->post_type, '_' ) ) { 513 $templates[] = 'single-' . str_replace( '_', '-', $object->post_type ) . '.php'; 514 } 515 498 516 $templates[] = "single-{$object->post_type}.php"; 499 517 } 500 501 518 $templates[] = "single.php"; 502 519 503 520 return get_query_template( 'single', $templates );