Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Ensure taxonomy query args are filterable#2380

Closed
danielbachhuber wants to merge 3 commits intodevelopfrom
register-taxonomy-args-above-filter
Closed

Ensure taxonomy query args are filterable#2380
danielbachhuber wants to merge 3 commits intodevelopfrom
register-taxonomy-args-above-filter

Conversation

@danielbachhuber
Copy link
Member

No description provided.

@danielbachhuber danielbachhuber added this to the 2.0 Beta 13 milestone Mar 17, 2016
@danielbachhuber
Copy link
Member Author

@WP-API/amigos #reviewmerge

@danielbachhuber
Copy link
Member Author

@joehoyle Thoughts on the build failure?

@kjbenk
Copy link
Contributor

kjbenk commented Mar 17, 2016

@danielbachhuber you need to add tax_query to the array of valid rest query parameters for the tests to work :)

https://github.com/WP-API/WP-API/blob/develop/lib/endpoints/class-wp-rest-posts-controller.php#L615-L628

@danielbachhuber
Copy link
Member Author

you need to add tax_query to the array of valid rest query parameters for the tests to work :)

I know — wondering why we aren't doing that right now.

@BE-Webdesign
Copy link
Member

I know — wondering why we aren't doing that right now.

That is in #2273 which could use some of your feedback!!

@danielbachhuber danielbachhuber modified the milestone: 2.0 Beta 13 Mar 23, 2016
@rmccue
Copy link
Member

rmccue commented Sep 13, 2016

I know — wondering why we aren't doing that right now.

tax_query wasn't allowed because you could have a taxonomy that's non-public and non-REST-enabled, and then query by that. We need to do validation on tax_query to ensure all queried taxonomies are allowed.

That's not an issue if we force the parameter to something we're building; i.e. set $tax_query = [] before we pass it through.

@rmccue
Copy link
Member

rmccue commented Sep 13, 2016

That's not an issue if we force the parameter to something we're building; i.e. set $tax_query = [] before we pass it through.

(i.e. it shouldn't be an issue with the way the code is written at the moment, so it should be allowed, I think)

@kadamwhite
Copy link
Contributor

From @rmccue:

> Two changes to make:
> a) add `tax_query` to allowed args, and
> b) set `$args['tax_query'] = array()` before the `$taxonomies` loop
> *but* after the `filter` merge
@codecov-io
Copy link

codecov-io commented Sep 14, 2016

Current coverage is 94.54% (diff: 100%)

Merging #2380 into develop will increase coverage by <.01%

@@            develop      #2380   diff @@
==========================================
  Files            11         11          
  Lines          3627       3629     +2   
  Methods         173        173          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           3429       3431     +2   
  Misses          198        198          
  Partials          0          0          

Powered by Codecov. Last update 427564a...2a1c5fb

@kadamwhite kadamwhite force-pushed the register-taxonomy-args-above-filter branch from 2a1c5fb to a057bbd Compare September 14, 2016 15:08
@kadamwhite
Copy link
Contributor

I don't know what to do to suppress that error, could use some help on this

@kadamwhite
Copy link
Contributor

After discussion in slack, this PR needs a clear description communicating what it is doing (seems to be permitting tax_query to be used in plugins); and we need to decide whether it is still desired after resolving #2799

@danielbachhuber danielbachhuber deleted the register-taxonomy-args-above-filter branch December 2, 2016 22:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants