#48558 closed enhancement (fixed)
Return the taxonomy object in register_taxonomy()
| Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
In 47186: