[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
Fri Feb 19 03:29:09 UTC 2021


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

Comment (by peterwilsoncc):

 In my [https://github.com/WordPress/wordpress-develop/pull/1021 linked
 pull request]:

 * Added a bunch of tests for `edit_term_link()`, `get_edit_term_link()`
 * Tests ensure an integer is sent to the filter in the hooks
 `get_edit_term_link` and `edit_term_link`
 * Tests ensure a `WP_Term` object is sent to the filter in `term_link`
 * Fixed filters per [comment:6 comment 6] and [comment:11 comment 11]
 * Changed `edit_term_link()` to also accept a term ID or object in line
 with `get_edit_term_link()` -- it seems potentially confusing for the
 equivalent parameters to differ
 * There was accidental revert of an earlier commit in the patch, removed
 that

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


More information about the wp-trac mailing list