Added support for sortable columns#1281
Merged
jtsternberg merged 4 commits intoCMB2:developfrom Jul 16, 2019
Merged
Conversation
Added support to sort columns automatically by the type of field text, number, date or time.
Member
|
This is pretty cool. There's definitely some Code Standards cleanup required. Can you please address that? |
Contributor
Author
|
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
requested changes
Jul 15, 2019
Member
jtsternberg
left a comment
There was a problem hiding this comment.
Thanks for your submission. I added a few suggestions.
Contributor
Author
Fixed @jtsternberg, thank you for your help |
jtsternberg
added a commit
that referenced
this pull request
Jul 16, 2019
Member
|
Nice work on this @RubenMartins! Thank you for submitting and following up with the cleanup. |
Contributor
Author
|
@jtsternberg Can this be added to the 2.7.0 milestone? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: