#48558 closed enhancement (fixed)
Return the taxonomy object in register_taxonomy()
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 5.4 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | Taxonomy | Keywords: | has-patch |
| Focuses: | Cc: |
Description
Background:
register_post_type()returns the registered post type object on success, aWP_Errorobject on error.register_taxonomy()returns nothing on success, aWP_Errorobject on error.
From a consistency point of view, I think it would make sense for register_taxonomy() to return the registered taxonomy object as well.
Some history, for context:
- [5525] introduced
register_taxonomy(). - [11998] introduced
register_post_type(). - [12597] introduced a return value for
register_post_type(), the$argsarray at the time. - [37890] introduced
WP_Post_Typeobject, and changedregister_post_type()return value to that. - [38747] introduced
WP_Taxonomyobject, but not as aregister_taxonomy()return value, as it never had one.
Attachments (1)
Change History (5)
Note: See
TracTickets for help on using
tickets.
In 47186: