Rename Members List to Memberships and add Orders-style filter panel - #3728
Draft
dparker1005 wants to merge 1 commit into
Draft
Rename Members List to Memberships and add Orders-style filter panel#3728dparker1005 wants to merge 1 commit into
dparker1005 wants to merge 1 commit into
Conversation
- Rename user-facing "Members"/"Members List" labels to "Memberships" on the list page, admin menu, admin bar, and header nav. Slugs, capabilities, and hook names are unchanged. Person-oriented actions (Add New Member, Search Members, Edit Member) keep "member" language. - Replace the overloaded level dropdown with a filter sidebar panel matching the Orders and Subscriptions pages: Level, Status (Active, Cancelled, Expired, All Ended), and an Ended Memberships selector controlling whether rows are hidden when the same level or any level is active again. - Level and status filters can now be combined, and ended views always hide rows where the user has re-activated the same level. - Add pmpro_sanitize_memberships_list_filters(), pmpro_memberships_list_filter_sql(), and pmpro_get_ended_membership_statuses() (filterable) so the list table and the members CSV export share one set of filter semantics. - Legacy l=cancelled|expired|oldmembers links are mapped to the new filters with their original users-with-no-active-membership behavior preserved. - Fix the End Date column rendering blank when filtering ended memberships with the new status parameter. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What this does
Terminology: Members List → Memberships
Now that a single user can hold multiple levels, each row in this list is a membership (user + level), not a member — the query has grouped by
u.ID, mu.membership_idfor a while, so the labels are catching up to the code.pmpro-memberslist), capabilities, or hook names — existing links and add-ons are unaffected.Filtering: same filter panel as Orders and Subscriptions
Replaces the single overloaded dropdown (which mixed levels with
Cancelled/Expired/Old Membersand could not combine them) with thepmpro-filter-panelsidebar used on the Orders and Subscriptions pages:pmpro_get_ended_membership_statuses()(expired,cancelled,admin_cancelled,changed,admin_changed,inactive) rather than<> 'active', so incomplete-checkout statuses (token,pending,review,error) can't leak in.Ended-view semantics
Each row represents the current state of a user's relationship with a level, so ended views always hide a row when that same level has been re-activated (a user who expired out of Gold and re-purchased Gold is not an "expired membership"). The old behavior — only show users with no active membership at all — is the "any level" option. This fixes the long-standing quirk where a user who downgraded from Gold to Silver never appeared anywhere as an ended Gold membership.
Shared query semantics for list + export
New
pmpro_sanitize_memberships_list_filters()andpmpro_memberships_list_filter_sql()helpers are used by both the list table and the members CSV export, so exported rows always match the rows on screen.Backwards compatibility
l=cancelled,l=expired, andl=oldmembersURLs (dashboard, reports, admin activity email, add-ons) are mapped to the newstatus/excludeactiveparams with their original no-active-membership behavior preserved.lvalues behave exactly as before (level + active).pmpro_members_list_sqland all column/CSV hooks fire unchanged.Bug fix along the way
column_enddate()keyed off the legacylvalues, so ended views reached via the newstatusparam rendered blank end dates; it now uses the normalized status filter.Testing
admin.php?page=pmpro-memberslist&l=expiredand confirm it matches the pre-change results (only users with no active membership), with the panel reflecting Expired + "any level".🤖 Generated with Claude Code