[wp-trac] [WordPress Trac] #38553: Posts Controller handle_terms throws warning

WordPress Trac noreply at wordpress.org
Sat Oct 29 01:29:38 UTC 2016


#38553: Posts Controller handle_terms throws warning
----------------------------+------------------------------
 Reporter:  timmydcrawford  |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  REST API        |     Version:  trunk
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by ChopinBach):

 Replying to [comment:2 timmydcrawford]:
 it doesn't handle something like
 >
 > {{{
 > categories=[1,2,3]
 > }}}

 I think that is expected, because that is equivalent to a string not an
 array literal in `x-www-form-urlencoded`, so it is like saying `'left
 bracket 1,2,3 right bracket'`.  If you want to pass an array via query
 params you have to do `?categories[0]=1&categories[1]=2` at least that is
 how PHP can handle array input for `x-www-form-urlencoded` requests; not
 sure if other languages do things differently. We could do something to
 make it work for `[1,2,3]`, but it would probably over complicate things,
 even though that looks better to me too.

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


More information about the wp-trac mailing list