#48558 closed enhancement (fixed)
Return the taxonomy object in register_taxonomy()
Reported by: | SergeyBiryukov | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | has-patch |
Focuses: | Cc: | ||
PR Number: |
Description
Background:
register_post_type()
returns the registered post type object on success, aWP_Error
object on error.register_taxonomy()
returns nothing on success, aWP_Error
object 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$args
array at the time. - [37890] introduced
WP_Post_Type
object, and changedregister_post_type()
return value to that. - [38747] introduced
WP_Taxonomy
object, 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: