Opened 2 years ago
Closed 2 years ago
#61152 closed enhancement (wontfix)
Pass the full $args array to hook 'get_categories_taxonomy' and allow modification
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 6.5 |
| Component: | Taxonomy | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
Currently, hook point get_categories_taxonomy only receives single element of the $args array: $args['taxonomy'].
Passing the entire $args array instead would permit modification at that hook point and would make it simple to provide additional function at that point, such as controlling the results of get_categories by setting $args['exclude'], $args['include'] and thus controlling which categories are listed by the things such as category widgets, etc.
Change History (3)
#1
follow-up:
↓ 2
@
2 years ago
- Description modified (diff)
- Summary changed from Change Request: Please pass the full $args array to hook 'get_categories_taxonomy' and allow modification to Pass the full $args array to hook 'get_categories_taxonomy' and allow modification
#2
in reply to:
↑ 1
@
2 years ago
Replying to swissspidy:
Hi there and welcome to Trac!
This hook is used in
get_categories(), which in turn usesget_terms()/WP_Term_Query. All term queries' arguments can be filtered using the `get_terms_args` filter. Does that filter cover your use case?
Yes! That gave me what I needed. Thanks.
Hi there and welcome to Trac!
This hook is used in
get_categories(), which in turn usesget_terms()/WP_Term_Query. All term queries' arguments can be filtered using the `get_terms_args` filter. Does that filter cover your use case?