-
Notifications
You must be signed in to change notification settings - Fork 566
Added support for sortable columns #1281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added support to sort columns automatically by the type of field text, number, date or time.
|
This is pretty cool. There's definitely some Code Standards cleanup required. Can you please address that? |
|
Clicked the wrong button and closed this unintentionally, sorry for the notifications. @jtsternberg Can you please review the cleanup? If you found any further necessary cleanup can you please point it out? |
jtsternberg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your submission. I added a few suggestions.
Fixed @jtsternberg, thank you for your help |
|
Nice work on this @RubenMartins! Thank you for submitting and following up with the cleanup. |
|
@jtsternberg Can this be added to the 2.7.0 milestone? |
Added support to sort columns automatically by the type of field text, number, date or time.
Description
Added support to sort columns automatically in admin tables list when the "column" attribute is true.
This will sort by field type (text, number, date or time) using (query "orderby" -> meta_value, meta_value_num, meta_value_time or meta_value_date accordingly).
Motivation and Context
There was a need to sort columns generated by CMB2 automatically without custom code.
Fixes #831.
Risk Level
minimal risk
Testing procedure
Using the example-functions.php you can verify that the field with column attribute defined will automatically be able to sort.
Types of changes
New feature (non-breaking change which adds functionality)
Checklist: