get_cat_id() fails with category names containing ampersand
|Reported by:||Kenshino||Owned by:|
echo get_cat_id('News'); results in 3 (as expected); echo get_cat_id('Test OtherName'); results in 8 (as expected); echo get_cat_id('Test&OtherName'); Results in 0 echo get_cat_id('News & Media'); Results in 0
All the category names were created in the Category Edit page, category names were copied from the text box directly into the code to allow no formatting issues.
I tracked the code to get_term_by and I think the ampersand in category name screws up possibly after being added into the prepared SQL statement.