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
Open
davidsword wants to merge 2 commits into
Open
Add "VIP Support" badge in Users list for VIP Support users#74davidsword wants to merge 2 commits into
davidsword wants to merge 2 commits into
Conversation
Badge displays if `_vip_support_user` user meta value is set. Always shows "VIP Support" as a role for VIP Support users, regardless if they have a vip_support role or not. Does not currently factor in edit user / profile screen, just the Users list.
|
How will the background-coloured block look if the screen is narrow enough to wrap the wording? Maybe consider having a |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.