mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@45813 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -210,7 +210,7 @@ class WP_REST_Taxonomies_Controller extends WP_REST_Controller {
|
||||
}
|
||||
|
||||
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 ) ) {
|
||||
|
||||
Reference in New Issue
Block a user