[wp-trac] Re: [WordPress Trac] #9323: Legacy get_category_link function call in get_term_link function should probably use $term->ID or be removed

WordPress Trac wp-trac at lists.automattic.com
Fri Mar 13 03:18:01 GMT 2009


#9323: Legacy get_category_link function call in get_term_link function should
probably use $term->ID or be removed
--------------------------+-------------------------------------------------
 Reporter:  ev3rywh3re    |       Owner:  ryan                                                         
     Type:  defect (bug)  |      Status:  new                                                          
 Priority:  normal        |   Milestone:  2.8                                                          
Component:  Taxonomy      |     Version:  2.8                                                          
 Severity:  normal        |    Keywords:  get_the_term_list, get_term_link, get_category_link has-patch
--------------------------+-------------------------------------------------
Changes (by filosofo):

  * keywords:  get_the_term_list, get_term_link, get_category_link =>
               get_the_term_list, get_term_link,
               get_category_link has-patch


Comment:

 Replying to [comment:1 ev3rywh3re]:
 > Great, I may have reported too soon. It may be a Dreamhost PHP CGI
 issue. Other systems I maintain don't seem to cause an error. Switching
 that domain to Fast-CGI fixed it. The error does not reproduce on the
 mod_php version 4.x or 5.x servers I maintain.

 Actually, what you're probably seeing is that the bug shows up only if
 "pretty" permalinks are not enabled.

 I've attached a patch with what I think is the best solution: make
 get_term_link() accept only a term id as its first argument, instead of
 the multiple options it currently (sorta) does: term object, term id, or
 term slug.

 This is only place in core WP where get_term_link() is called with
 something that might not be a term ID, and that can easily be corrected
 (see patch).  Also, both get_category_link() and get_tag_link() expect
 term IDs, so it's consistent behavior to require the ID.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9323#comment:2>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list