[wp-trac] [WordPress Trac] #10663: Category name handling wrong function is_category
WordPress Trac
wp-trac at lists.automattic.com
Thu Aug 20 15:40:47 UTC 2009
#10663: Category name handling wrong function is_category
--------------------------+-------------------------------------------------
Reporter: Azaroth | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone:
Component: General | Version: 2.8.4
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
When putting numbers in front of the category names, Wordpress uses them
as basis for the function is_category which leads to problems with e.g.
plugins using this function.
Example:
- 3 Categories: "News" (id 1), "1st Release" (id 2), "2nd Release" (id 3)
- Trying to check the category with is_category(1) works for news, but
also returns true for the category "1st Release"
- Trying to check the category with is_category(2) returns true for both,
"1st Release" and "2nd Release"
This behaviour is not expected. It might be interesting when you
explicitely give the category numbers as names (e.g. "1", "2", "3").
Changing the in_array function to a simple equal comparison makes
everything work as expected.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10663>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list