[wp-trac] [WordPress Trac] #16469: Cannot pass in ID for get_term_link() if using custom taxonomy

WordPress Trac wp-trac at lists.automattic.com
Sun Feb 6 09:49:36 UTC 2011


#16469: Cannot pass in ID for get_term_link() if using custom taxonomy
-------------------------------+------------------------------
 Reporter:  sparkweb           |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Taxonomy           |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------
Changes (by dd32):

 * keywords:   => reporter-feedback


Comment:

 http://core.trac.wordpress.org/browser/trunk/wp-
 includes/taxonomy.php#L2820

 > Cannot pass in ID for get_term_link() if using custom taxonomy.
 Are you passing an integer, or a string of the ID? Using (int)$term will
 retrieve a term by id, (string)$id will cause it to do a slug lookup
 instead, This is standard across the board for the taxonomy API. Can you
 confirm if this is the way you're calling get_term_link() ?

 > term name and that name legitimately includes a "/" the term link can't
 be found.
 There's another ticket for this #16282, get_term_link() has never been
 designed to be passed a term name. Rather, a term slug. In 3.1 this is
 being caught a bit more, but it has always been a possibility through
 other versions.

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


More information about the wp-trac mailing list