[wp-hackers] Weird behavior (maybe a "bug") in get_term_link()

Austin Matzko austin at ilfilosofo.com
Wed May 19 13:50:00 UTC 2010


On Wed, May 19, 2010 at 7:49 AM, Davit Barbakadze <jayarjo at gmail.com> wrote:
> Passing my term_id as (int)$term_id has solved the problem. But I
> think it's not what the one may expect in this case. Is there any
> reason why is_int() cannot be replaced by is_numerical() ?

Because slugs can be numerical strings.

get_term_link() has this messy behavior of accepting different types
of arguments basically just for backwards compatibility with plugins
and themes.  As you can see from the comments on
<http://core.trac.wordpress.org/ticket/9323> my patch to make it
accept only integers went in to trunk long enough only to cause
backwards-compatibility issues on WP.com.


More information about the wp-hackers mailing list