Hi,
How to make first and last name columns sortable? I have a view for showing user accounts. I selected a table with sortable columns, but I can only see the email and registration date columns allow to sort data. The wpv-heading has name attribute "first_name" and "last_name".
Peter
Hi Peter,
Thank you for contacting us and I'll be happy to assist.
As explained in this reply ( https://toolset.com/forums/topic/wpv-heading-with-user-fields/#post-324702 ), WordPress doesn't support ordering user query results based on "first_name" and "last_name".
I've internally passed this feedback to add a notice or warning about this limitation in view's interface and/or user-facing documentation. I'll keep you updated with the progress through this ticket.
For now, a workaround can be to drop the built-in query based table column sorting and add it through front-end script like:
hidden link
regards,
Waqar
Hi Peter,
Just wanted to update you that thanks to your report, we've added a note in our documentation that "Only Post Fields can be used as sorting criteria."
( ref: https://toolset.com/documentation/user-guides/views-shortcodes/#vf-154328 )
Thank you for bringing this forward.
regards,
Waqar