This repository was archived by the owner on Sep 26, 2022. It is now read-only.
Add "VIP Support" badge in Users list for VIP Support users #74
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.
In the users list, if
_vip_support_useruser meta value is set, that users role list will always show up as "VIP Support", regardless of their current role(s). Any role list with "VIP Support" text is then replaced with a badge. A little hacky with the jQuery, but the Roles column does not have a filter, and the roles themselves can't be edited to include HTML. (The alternative was to add an extra column, but that seemed a bit overkill).Does not currently factor in edit user / profile screen, just the Users list, can easily include in future if there's further interest in this PR.
The only caveat I could think of was the role of a VIP Support user is actually "hidden" by the badge, but any VIP staff would be using WPCLI and know how to get this info anyways. I was going to tuck the actual role list in a
titleattribute on the badge, but that would include the VIP Support role, which may or may not be true.