[wp-trac] [WordPress Trac] #50225: get_edit_term_link can technically accept also WP_Term and object for $term_id

WordPress Trac noreply at wordpress.org
Tue Nov 16 14:55:19 UTC 2021


#50225: get_edit_term_link can technically accept also WP_Term and object for
$term_id
---------------------------------------------+-----------------------------
 Reporter:  david.binda                      |       Owner:  hellofromTonya
     Type:  defect (bug)                     |      Status:  closed
 Priority:  normal                           |   Milestone:  5.9
Component:  Taxonomy                         |     Version:
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit  |     Focuses:  performance
---------------------------------------------+-----------------------------
Changes (by hellofromTonya):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52180" 52180]:
 {{{
 #!CommitTicketReference repository="" revision="52180"
 Taxonomy: Allow  `get_*_*_link()` and `edit_term_link()` functions to
 accept a term ID, `WP_Term`, or term object.

 `get_term()` accepts a term ID, instance of `WP_Term`, or an object (i.e.
 `stdClass` as a result of a db query). Functions that use `get_term()`
 also now allow for the same data types.

 Why? For consistency, removing extra processing code in consuming
 functions, and performance.

 Functions changed in this commit are:
 * `get_category_feed_link()`
 * `get_term_feed_link()`
 * `get_tag_feed_link()`
 * `get_edit_tag_link()`
 * `get_edit_term_link()`
 * `edit_term_link()`

 For each of consumer of these functions, changes to pass the object
 instead of the term ID.

 Includes unit/integration tests for test coverage of these changes.

 Follow-up to [6365], [9136], [9340], [14711], [15792], [15800], [18827],
 [32606], [36646], [37252].

 Props davidbinda, johnbillion, peterwilsoncc, hellofromTonya,
 sergeybiryukov, mista-flo, hareesh-pillai, audrasjb, jeffpaul, chaion07.
 Fixes #50225.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/50225#comment:20>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list