[wp-trac] [WordPress Trac] #34728: Registering API argument that conflicts with public_query_var can cause warnings

WordPress Trac noreply at wordpress.org
Wed Nov 18 18:53:11 UTC 2015


#34728: Registering API argument that conflicts with public_query_var can cause
warnings
-----------------------------+-----------------------------
 Reporter:  danielbachhuber  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  REST API         |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Originally reported in https://github.com/WP-API/WP-API/issues/982

 > Weird things happen if you happen to use a `public_query_var` GET param
 in your endpoint. For example, I have a taxonomy called `series` which has
 the `public_query_var` of `series` - however I also have an endpoint that
 has a GET param of `series` which is an array. This leads to Weirdness and
 Warnings (TM).
 >
 > [...]
 >
 > `parse_request` in my case was still too late for some warnings as
 `parse_request` is called after the vars have been set on the `$wp` object
 (which expects types to match the public_query_var type (which is always
 scalar)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34728>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list