|Reported by:||swissspidy||Owned by:||swissspidy|
|Component:||Taxonomy||Keywords:||has-patch has-unit-tests 4.7-early commit needs-dev-note|
In a similar vein to #36217, a WP_Taxonomy class would make many things easier, like helping with documentation and preventing accidental errors.
In my proof-of-concept patch, the global $wp_taxonomies would be an array of WP_Taxonomy objects. The class properties wouldn't change for backward compatibility and any class methods would only add some benefit to it.
I also implemented the ArrayAccess interface because the taxonomy args are often passed as arrays (e.g. in the registered_taxonomy filter.
This ticket should:
- Introduce the WP_Taxonomy class and have base properties and methods for interacting with a post type object.
- Apply the new class where it can be used within core.
- Provide tests for any methods introduced.
Change History (33)
in reply to:
13 months ago
- Type changed from defect (bug) to enhancement