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
This commit is contained in:
whyisjake 2021-01-28 00:53:02 +00:00
parent ed54a900e3
commit 49ffe91b72
2 changed files with 2 additions and 2 deletions

View File

@ -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,
),

View File

@ -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.