Michael Simpson on "[Plugin: Contact Form DB] Does sorting must be case-sensitive ?"

ساخت وبلاگ

Hello,
I'm trying to sort my cfdb-table using SortByField, but it's case-sensitive. Any way no make it case-insensitive?

https://wordpress.org/plugins/contact-form-7-to-database-extension/

It doesn't have an option directly. But you could try making a temporary field will everything uppercase then sort by that.

If you are sorting by field "last_name", create last_name_uc field and sort by that.

[cfdb-table form="myform" trans="last_name_uc=strtoupper(last_name)&& SortByField(last_name_uc)"]

Mr. Simpson, thank you very much for your usual amazingly fast and kind support.
It did work perfectly. Let me just point out that I tried something similar, after reading the filter docs, but it didn't work because of (I think) an error on this code ("Filter Functions vs. Transforms Functions" paragraph):
trans=”first_name=strtoupper(first_name)”

Not being a coder, I did not realize at first, but I suppose it's a variable attributing a value to itself.

All the best.

Be careful not to have curly-quotes in the shortcode.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 269 تاريخ : دوشنبه 11 مرداد 1395 ساعت: 3:15