WordPress.org

Make WordPress Core

Ticket #18859: 18859.5.patch

File 18859.5.patch, 759 bytes (added by johnbillion, 3 years ago)
  • src/wp-includes/template.php

     
    380380 * e.g. 'single_template'.
    381381 *
    382382 * @since 1.5.0
     383 * @since 4.4.0 `single-{post_type}-{post_name}.php` was added to the top of the template hierarchy.
    383384 *
    384385 * @see get_query_template()
    385386 *
     
    390391
    391392        $templates = array();
    392393
    393         if ( ! empty( $object->post_type ) )
     394        if ( ! empty( $object->post_type ) ) {
     395                $templates[] = "single-{$object->post_type}-{$object->post_name}.php";
    394396                $templates[] = "single-{$object->post_type}.php";
     397        }
     398
    395399        $templates[] = "single.php";
    396400
    397401        return get_query_template( 'single', $templates );