Enhance memberlist csv column filtering #517
Draft
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.
Implements #481.
I've changed the way the columns array works. I've added the heading as the key (as you mentioned @strangerstudios) and I also added the ability to specify a callback which enabled me to include columns like "expires" or "joined" as filterable columns.
$extra_columns
are merged with$default_columns
since the behaviour is now similar.pmpro_members_list_csv_heading
still works but will break if someone tries to add/remove columns using this filter.I've done some tests and we can now remove and/or re-order columns using
pmpro_members_list_csv_default_columns
. Actually it's now easier to remove/re-order columns because we are using the heading as the key.I haven't managed to test the use-case for "oldmembers".