[wp-trac] [WordPress Trac] #34373: Don't set is_home=>true in WP_Query during REST request

WordPress Trac noreply at wordpress.org
Tue Oct 20 19:36:58 UTC 2015


#34373: Don't set is_home=>true in WP_Query during REST request
-----------------------------+--------------------------------------
 Reporter:  danielbachhuber  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  4.4
Component:  REST API         |    Version:
 Severity:  normal           |   Keywords:  dev-feedback needs-patch
  Focuses:                   |
-----------------------------+--------------------------------------
 `WP_Query` sets `is_home=>true` when a variety of other conditions aren't
 set: https://core.trac.wordpress.org/browser/tags/4.3/src/wp-
 includes/query.php#L1751

 In a REST request, `is_home` should remain `false` as `home` isn't a
 defined context in a REST request.

 We could extend the conditional to respect the `REST_REQUEST` constant.
 However, it raises a couple more questions:

 * Should `is_search` be set to `true` if the `s` parameter is used in a
 REST request? Similarly, should `is_date` and others be set based on query
 arguments, as they are now?
 * Do we need an `is_rest` attribute for `WP_Query`?

 Related conversation: https://github.com/WP-API/WP-API/issues/926

 Core ticket stems from: https://github.com/WP-API/WP-API/issues/1014

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


More information about the wp-trac mailing list