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

Allow Terms Collection Params to be Filtered #1882

Merged
merged 2 commits into from Jan 4, 2016

Conversation

rachelbaker
Copy link
Member

Adds a filter for the prepared_args before passing them to get_terms() (matching behavior to the Posts and Users collections), and then adjusting the pagination headers so that the prepared_args are used instead of only the Request params.

See #1878

* passed to get_terms.
* @param WP_REST_Request $request The current request.
*/
$prepared_args = apply_filters( 'rest_terms_query', $prepared_args, $request );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter naming matches other similar filters, but pre_rest_terms_query would be a better match for Core's naming convention. @rmccue @joehoyle thoughts? Should we change these now for Posts, Users, etc?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference either way, but renaming would make sense to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a separate issue for this #1937

@rachelbaker rachelbaker added this to the 2.0 Beta 10 milestone Dec 21, 2015
danielbachhuber added a commit that referenced this pull request Jan 4, 2016
Allow Terms Collection Params to be Filtered
@danielbachhuber danielbachhuber merged commit 41f35f0 into develop Jan 4, 2016
@danielbachhuber danielbachhuber deleted the fix-terms-pagination-headers branch January 4, 2016 15:26
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.

None yet

2 participants