#2652 closed defect (bug) (invalid)
category_exists() checks using slug
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | lowest | |
Severity: | trivial | Version: | 2.0.2 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
Okay, maybe I'm missing something, but I noticed when you give category_exists()
a category name, it creates a sanitized version of that name (i.e. what it's slug would be) and then sees if there are any categories that already have that slug. However, you can change the slugs for categories in the admin area to something completely different than the category name.
Now is category_exists()
really just used to see if a category slug exists? Or is it just checking in a bad method?
Change History (4)
#2
@
19 years ago
I really need an edit button and to not submit tickets so late at night. :|
What I meant in my original ticket post:
"Now is category_exists()
really just used to see if a category slug exists (so no slug collisions occur)? Or is it just checking via what appears to be a bad method?
Er, meant to hit preview rather than submit.
Anyway, if it is just used to check for slug collisions, shouldn't this be called like "category_slug_exists()" or something? I was going to use this function for a script I'm writing that manually creates posts and any needed categories, but I want to check my category name, not the slug (I'm currently manually querying).