[wp-hackers] case sensitivity on new term creation
casey.bisson at gmail.com
Sat Mar 23 03:39:53 UTC 2013
I'm not aware of anything in WP that would enforce case sensitivity there, but the MySQL collation settings would.
There's a chance the table or database is collated in utf8_bin or some other case sensitive collation. A better alternative would be utf8_general_ci or utf8_unicode_ci.
You can check the collation with the following mysql command:
SHOW TABLE STATUS LIKE 'wp_terms';
It's easier to read in the terminal if you put \G on the end, however. Like the following:
SHOW TABLE STATUS LIKE 'wp_terms'\G
That will report the default collation for that table.
On Mar 22, 2013, at 5:19 PM, Haluk Karamete <halukkaramete at gmail.com> wrote:
> What's a good way to modify the Wordpress new term creation functionality
> so that it does not create new terms ( thus -2 slugs _ for those terms
> where only the casing is different?
> By default, WP creates two seperate terms for "Joe" ( with slug joe ), and
> for "joe" ( with slug joe-2).
> I want WordPress to do a case insensitive search in determining if joe was
> used. Currently, the search is case sensitive.
> If it were to treat Joe and joe as the same, then I can have totally
> avoided the "joe".
> With this modification, yes I am aware that I won't be able to create
> "Apple" and "apple" as two separate terms one to mean the Apple Inc and the
> other the fruit. But that's fine me. In my case, I am getting a lot of -2
> slugs for terms that mean the same thing and tha'ts because my users are
> careless. So I do need to change the default.
> How can I achieve this?
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers