diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 716f3297c0..11ae1ec798 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1094,7 +1094,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { } /** - * Sets the template for a page. + * Sets the template for a post. * * @since 4.7.0 * @access public @@ -1922,14 +1922,12 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { ); } - if ( 'page' === $this->post_type ) { - $schema['properties']['template'] = array( - 'description' => __( 'The theme file to use to display the object.' ), - 'type' => 'string', - 'enum' => array_keys( wp_get_theme()->get_page_templates() ), - 'context' => array( 'view', 'edit' ), - ); - } + $schema['properties']['template'] = array( + 'description' => __( 'The theme file to use to display the object.' ), + 'type' => 'string', + 'enum' => array_keys( wp_get_theme()->get_page_templates( null, $this->post_type ) ), + 'context' => array( 'view', 'edit' ), + ); $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 25e90b33d4..012a0a96d2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta2-39181'; +$wp_version = '4.7-beta2-39182'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.