[wp-trac] [WordPress Trac] #25116: edit_tag_link() calls edit_term_link() with params out of order

WordPress Trac noreply at wordpress.org
Wed Aug 21 22:12:55 UTC 2013


#25116: edit_tag_link() calls edit_term_link() with params out of order
-------------------------+-------------------------------------------------
 Reporter:  pbiron       |      Owner:
     Type:  defect       |     Status:  new
  (bug)                  |  Milestone:  Awaiting Review
 Priority:  normal       |    Version:  3.6
Component:  Template     |   Keywords:  2nd-opinion has-patch needs-testing
 Severity:  normal       |
-------------------------+-------------------------------------------------
 I think `edit_tag_link()` calls `edit_term_link()` with parameters out of
 order.

 On [http://core.trac.wordpress.org/browser/tags/3.6/wp-includes/link-
 template.php#L669 line 669], `edit_tag_link()` calls `edit_term_link()`
 like so
 {{{
 $link = edit_term_link( $link, '', '', false, $tag );
 }}}
 but I believe that call should have the last 2 params reversed, as in
 {{{
 $link = edit_term_link( $link, '', '', $tag, false );
 }}}
 since the signature for `edit_term_link()` is (on
 [http://core.trac.wordpress.org/browser/tags/3.6/wp-includes/link-
 template.php#L715 line 715])
 {{{
 edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo
 = true )
 }}}
 (i.e., with the term/tag as the 4th param and the boolean echo as the
 5th).

 Can anyone else verify that this is, indeed, a bug?  I believe it is since
 calling `edit_tag_link()` as is results in the following error messages:
 {{{
 Notice: Trying to get property of non-object in \wp-includes\link-
 template.php on line 720
 Notice: Trying to get property of non-object in \wp-includes\link-
 template.php on line 721
 Notice: Trying to get property of non-object in \wp-includes\link-
 template.php on line 721
 }}}
 but reversing the order of the last 2 params in the call to
 `edit_term_link()` results in the expected output (and no error messages).

 As far as I can tell, this bug has existed since
 [http://core.trac.wordpress.org/browser/tags/3.1/wp-includes/link-
 template.php#L675 v3.1].

--
Ticket URL: <http://core.trac.wordpress.org/ticket/25116>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list