From 49ffe91b72d796943d80744bba31b610ad25339d Mon Sep 17 00:00:00 2001 From: whyisjake Date: Thu, 28 Jan 2021 00:53:02 +0000 Subject: [PATCH] REST API: Only include the controller's own taxonomy in it's schema. Previously, all taxonomies were incorrectly exposed as possible values. This commit brings the changes from [49922] to the 5.6 branch. Props johnbillion, TimothyBlynJacobs. Fixes #51940. Built from https://develop.svn.wordpress.org/branches/5.6@50047 git-svn-id: http://core.svn.wordpress.org/branches/5.6@49748 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../rest-api/endpoints/class-wp-rest-terms-controller.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php index 3284017cdc..ddc6380873 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php @@ -965,7 +965,7 @@ class WP_REST_Terms_Controller extends WP_REST_Controller { 'taxonomy' => array( 'description' => __( 'Type attribution for the term.' ), 'type' => 'string', - 'enum' => array_keys( get_taxonomies() ), + 'enum' => array( $this->taxonomy ), 'context' => array( 'view', 'embed', 'edit' ), 'readonly' => true, ), diff --git a/wp-includes/version.php b/wp-includes/version.php index ea886358ee..818ddee9ec 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6.1-alpha-50046'; +$wp_version = '5.6.1-alpha-50047'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.