[wp-trac] [WordPress Trac] #42209: register_taxonomy with a non-sequential array index of post_types causes /wp-json/wp/v2/taxonomies to return an object not an array

WordPress Trac noreply at wordpress.org
Thu Aug 15 22:11:17 UTC 2019


#42209: register_taxonomy with a non-sequential array index of post_types causes
/wp-json/wp/v2/taxonomies to return an object not an array
--------------------------------------+--------------------------------
 Reporter:  spectacula                |       Owner:  TimothyBlynJacobs
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.3
Component:  REST API                  |     Version:  4.8.2
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-unit-tests has-patch  |     Focuses:
--------------------------------------+--------------------------------
Changes (by kadamwhite):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"45813" 45813]:
 {{{
 #!CommitTicketReference repository="" revision="45813"
 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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42209#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list