From 2f7f8d526bdae774820728679718db5f7c5daf4b Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 8 Nov 2016 22:41:30 +0000 Subject: [PATCH] Posts, Post Types: Fix post type templates with child themes. After [38951] added support for post type templates beyond pages, this fixes an issue where an empty meta box would be shown when using child themes. Fixes #38696. Built from https://develop.svn.wordpress.org/trunk@39168 git-svn-id: http://core.svn.wordpress.org/trunk@39108 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 2 +- wp-includes/class-wp-theme.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 392b51406d..1627439518 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -259,7 +259,7 @@ foreach ( get_object_taxonomies( $post ) as $tax_name ) { add_meta_box( $tax_meta_box_id, $label, $taxonomy->meta_box_cb, null, 'side', 'core', array( 'taxonomy' => $tax_name ) ); } -if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( null, $post_type ) ) > 0 ) { +if ( post_type_supports( $post_type, 'page-attributes' ) || count( get_page_templates( $post ) ) > 0 ) { add_meta_box( 'pageparentdiv', $post_type_object->labels->attributes, 'page_attributes_meta_box', null, 'side', 'core' ); } diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 66f623ee90..8b3661a888 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -1082,7 +1082,7 @@ final class WP_Theme implements ArrayAccess { $post_templates = isset( $post_templates[ $post_type ] ) ? $post_templates[ $post_type ] : array(); if ( $this->parent() ) { - $post_templates += $this->parent()->get_page_templates( $post ); + $post_templates += $this->parent()->get_page_templates( $post, $post_type ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index c28616fad2..1ebdeb32a1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta2-39167'; +$wp_version = '4.7-beta2-39168'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.