[wp-trac] [WordPress Trac] #42717: get_category_link() accepting object but not id

WordPress Trac noreply at wordpress.org
Tue Nov 28 04:37:22 UTC 2017


#42717: get_category_link() accepting object but not id
--------------------------+------------------------------
 Reporter:  belbo         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by chetan200891):

 @belbo Welcome to Trac!

 I think you should try


 {{{
 <?php
 get_category_link($term->id);
 }}}

 instead of


 {{{
 <?php
 get_category_link($term->id);
 }}}

 Because Term ID field returned as 'term_id' not 'id'.

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


More information about the wp-trac mailing list