Support

Home Forums Event Espresso Premium Role search on users by "not equal to"

Role search on users by "not equal to"

Posted: July 9, 2021 at 8:27 am


ICLE

July 9, 2021 at 8:27 am

Is there a way to search for registrants who do not have certain assigned roles?
All of my users will be “Subscribers” but they also have an anniversary role (ie: 07_jul). I am trying to find an easy way to identify any “Subscribers” without those additional roles.


Tony

  • Support Staff

July 22, 2021 at 12:09 pm

Hi there,

As this isn’t an issue with Event Espresso we wouldn’t provide support for this but I’ve seen something similar before so can comment a little on this.

I’m not sure I agree with using an additional role for this vs add a capability onto the user user but that’s another story.

Officially the WordPress UI doesn’t allow for users to have multiple roles, but within the database it is possible.

To do what you are requesting here you could use a meta_query, like so:

https://gist.github.com/Pebblo/be4297f8a3b99fc59e45bd00d94254b3

You must be logged in to reply to this support post. Sign In or Register for an Account

Event Espresso