Make WordPress Core

Opened 11 years ago

Closed 10 years ago

#34728 closed defect (bug) (invalid)

Registering API argument that conflicts with public_query_var can cause warnings

Reported by: joehoyle Owned by:
Priority: normal Milestone:
Component: REST API Version:
Severity: normal Keywords:
Cc: Focuses:

Description

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)

Change History (4)

This ticket was mentioned in ​Slack in #core by danielbachhuber. ​View the logs.


11 years ago

#2 @danielbachhuber
11 years ago

  • Reporter changed from danielbachhuber to joehoyle

This ticket was mentioned in ​Slack in #core-restapi by rmccue. ​View the logs.


11 years ago

#4 @joehoyle
10 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

This is no longer an issue, as we hook the rest api in pre-main query now, so the public_query_var that WP_Query looks for are no longer run.

Note: See TracTickets for help on using tickets.