Opened 6 years ago
Closed 5 years ago
#46665 closed enhancement (duplicate)
Add filter for taxonomies in get_taxonomies and get_object_taxonomies
Reported by: | mpol | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.1 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
It would be a good enhancement to be able to filter the taxonomies (not the terms) in the respective functions that are used to retrieve the taxonomies.
It can be used to order the postboxes for taxonomies on the post-edit screen for example. For reference, there was a feature request for a sorting plugin posted at:
https://wordpress.org/support/topic/cpt-ui-incompatibility/
It could also be used to filter out certain taxonomies.
The functions that could have this filter are get_taxonomies and get_object_taxonomies. I am not sure if the filter should only be run when objects are requested, or also if names are requested.
A good name for the filter might be 'get_taxonomies'.
Parameters would be $taxonomies and $output.
Is this something that is wanted in WordPress Core? If so, I can prepare a patch.
Hi @mpol - Thanks for the ticket! There's an existing ticket requesting a
get_taxonomies
filter. Let's merge this conversation with that one. #35250