mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
REST API: Always return post types list in taxonomies endpoint response as an array.
Prevents a non-sequential post type array such as [ 0 => 'post', 2 => 'page' ] from being improperly converted to an object in the taxonomy endpoint's response JSON. Props TimothyBlynJacobs, birgire, spectacula. Fixes #42209. Built from https://develop.svn.wordpress.org/trunk@45813 git-svn-id: http://core.svn.wordpress.org/trunk@45624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
00cb4c7dbd
commit
7eed5eff61
@ -210,7 +210,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( in_array( 'types', $fields, true ) ) {
|
if ( in_array( 'types', $fields, true ) ) {
|
||||||
$data['types'] = $taxonomy->object_type;
|
$data['types'] = array_values( $taxonomy->object_type );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( in_array( 'show_cloud', $fields, true ) ) {
|
if ( in_array( 'show_cloud', $fields, true ) ) {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-alpha-45812';
|
$wp_version = '5.3-alpha-45813';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user