[wp-trac] [WordPress Trac] #48558: Return the taxonomy object in register_taxonomy()

WordPress Trac noreply at wordpress.org
Mon Nov 11 02:05:57 UTC 2019


#48558: Return the taxonomy object in register_taxonomy()
----------------------------+-----------------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  enhancement     |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Taxonomy        |    Version:
 Severity:  normal          |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 Background:
 * `register_post_type()` returns the registered post type object on
 success, a `WP_Error` object on error.
 * `register_taxonomy()` returns nothing on success, a `WP_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 changed
 `register_post_type()` return value to that.
 * [38747] introduced `WP_Taxonomy` object, but not as a
 `register_taxonomy()` return value, as it never had one.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48558>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list