diff --git a/src/wp-includes/template.php b/src/wp-includes/template.php index 3e4e9a403e..b6fe475a8a 100644 --- a/src/wp-includes/template.php +++ b/src/wp-includes/template.php @@ -380,6 +380,7 @@ function get_search_template() { * e.g. 'single_template'. * * @since 1.5.0 + * @since 4.4.0 `single-{post_type}-{post_name}.php` was added to the top of the template hierarchy. * * @see get_query_template() * @@ -390,8 +391,11 @@ function get_single_template() { $templates = array(); - if ( ! empty( $object->post_type ) ) + if ( ! empty( $object->post_type ) ) { + $templates[] = "single-{$object->post_type}-{$object->post_name}.php"; $templates[] = "single-{$object->post_type}.php"; + } + $templates[] = "single.php"; return get_query_template( 'single', $templates );