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

Davit Barbakadze jayarjo at gmail.com
Wed May 19 14:35:20 UTC 2010


Wow, that's kinda twisted.

It never came to my mind though that slug can be numerical. Yeah...
but that's even more confusing...

Hmm... I think this can potentially bring more awkward moments, once
people start to use this intensively with custom taxonomies. Or is
there some kind of replacement already?

On Wed, May 19, 2010 at 5:50 PM, Austin Matzko <austin at ilfilosofo.com> wrote:
> 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.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Davit Barbakadze


More information about the wp-hackers mailing list