REST API: Only include the controller's own taxonomy in it's schema.

Previously, all taxonomies were incorrectly exposed as possible values.

Props johnbillion.
Fixes #51940.

Built from https://develop.svn.wordpress.org/trunk@49922


git-svn-id: http://core.svn.wordpress.org/trunk@49621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
TimothyBlynJacobs 2021-01-02 23:49:05 +00:00
parent 5363474e5d
commit 4e3c568fb1
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.7-alpha-49921';
$wp_version = '5.7-alpha-49922';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.