2014-07-09

Notes: cleaning up notes

← Older revision

Revision as of 14:08, 9 July 2014

Line 46:

Line 46:

== Notes ==

== Notes ==



* Uses: [[Function_Reference/apply_filters|<tt>apply_filters()</tt>]] Calls '<tt>term_link</tt>' filter on the finished link.

+

* Uses: [[Function_Reference/apply_filters|<tt>apply_filters()</tt>]] Calls <tt>'term_link'</tt> filter on the finished link.



* Uses global: (<tt>unknown</tt>) <tt>$wp_rewrite</tt>

+

* Uses global: (<tt>[[Class_Reference/WP_Rewrite|WP_Rewrite]]</tt>) <tt>$wp_rewrite</tt>



* Since the term can be an object, int, or string make sure that any numbers you pass in are explicitly converted to an integer. <tt>(int)$myID</tt>

+

* Since the term can be an object, integer, or string, make sure that any numbers you pass in are explicitly converted to an integer (example: <tt>(int) $term_id</tt>). Otherwise the function will assume that <tt>$term</tt> is a slug instead of a term ID.



* term->term_id doesn't currently work for the $term parameter. See [http://core.trac.wordpress.org/ticket/17652 this trac ticket] for more info.

+

* Because of the above, <tt>$term->term_id</tt> doesn't work for the <tt>$term</tt> parameter prior to [[Version 3.8|3.8.0]]. See [https://core.trac.wordpress.org/ticket/17646 this trac ticket] for more info.



* PHP may halt if you attempt to print an error result ("Catchable fatal error: Object of class WP_Error could not be converted to string"). Use is_string() to check the result of this function if you are not sure the term exists.

+

* PHP may halt if you attempt to print an error result (<tt>"Catchable fatal error: Object of class WP_Error could not be converted to string"</tt>). You should always use <tt>[[Function_Reference/is_wp_error | is_wp_error()]]</tt> to check the result of this function, in case the term does not exist.

== Change Log ==

== Change Log ==

Show more