[wp-hackers] has_tag()
Otto
otto at ottodestruct.com
Fri Apr 4 18:18:13 GMT 2008
Created a trac ticket for this, with patch. May as well move
discussion to there.
http://trac.wordpress.org/ticket/6590
On Fri, Apr 4, 2008 at 1:05 PM, Otto <otto at ottodestruct.com> wrote:
> On Fri, Apr 4, 2008 at 10:45 AM, Mistah P <mistahp.hackers at gmail.com> wrote:
> > That's nice work, Otto. It does exactly what I'd expect.
> >
> > I can see one potential issue though, and this may be splitting hairs.
> > Should there be a way to distinguish a numeric tag slug from a tag id?
> > Examples: the number 666 might be a tag people use in discussions of
> > occultism and the number 42 might be a tag used by Douglas Adams fans.
> >
> > Should there be a way to identify the type of identifier the function
> > should be looking for? I'm not advocating that, as it would probably
> > be pretty uncommon, but it may be worth discussing.
>
> Well, the existing functions like is_category and such don't do that.
> So they would have the same problem.
>
> However, the existing functions in 2.5 also allow you to input arrays
> of things, so I figured that was worth adding as well. If you give
> this one an array of tags, has_tag will return true if any of them
> match.
>
> Note that if you added the third parameter of "true" to the "in_array"
> functions below, then the strict checking mode would prevent the issue
> you're concerned about with it mixing up id's and slugs.
>
More information about the wp-hackers
mailing list