Opened 8 years ago
Closed 8 years ago
#39300 closed defect (bug) (fixed)
REST API Terms Controller Dynamic Filter Bug
Reported by: | Owned by: | jnylen0 | |
---|---|---|---|
Milestone: | 4.7.1 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | has-patch commit fixed-major |
Focuses: | Cc: |
Description
The rest_{$this->taxonomy}_collection_params
is incorrect. It is wrapped in single quotes instead of double quotes so the variable can not be parsed.
Line 977
return apply_filters( 'rest_{$this->taxonomy}_collection_params', $query_params, $taxonomy );
Attachments (3)
Change History (12)
#2
@
8 years ago
- Focuses rest-api removed
- Milestone changed from Awaiting Review to 4.7.1
Nice catch! Introduced in [39223].
#3
@
8 years ago
- Owner set to jnylen0
- Status changed from new to accepted
Thanks for the report and fix, and sorry for the bug :)
Let's just change the quotes here, not the inline documentation. If we make changes to this docblock, then we need to make the same changes to the other three (posts and users and comments). The _obj
suffix is also useful to indicate that the filter callback gets the full post type or taxonomy object, not just the name string.
#4
follow-up:
↓ 5
@
8 years ago
- Keywords commit added
39300.2.diff looks good to me, The documentation should be updated to both reflect the doc standard and also correct variable naming. The description adequately describes the content of the variable, no need to append _obj
to it.
#5
in reply to:
↑ 4
@
8 years ago
- Keywords commit removed
Replying to dd32:
The documentation should be updated to both reflect the doc standard and also correct variable naming. The description adequately describes the content of the variable, no need to append
_obj
to it.
This is fine, but updating only the terms docblock leaves the code in an inconsistent state with the other 3 filters that do the same thing for other object types. Updated the rest also in 39300.3.diff.
Update the docblock