This site is automated with JetFlow.io plugin and protected with WP Cerber security plugin

Newsletter Subscription

If you want to subscribe to our monthly newsletter, please submit the form below.

 

Check if user has a particular role

jetFlow.io > Documentation  > Creating workflows  > Check if user has a particular role

Check if user has a particular role

Sometimes we need to control how the workflow is executing based on the currently logged in user role assigned. That’s easy. As you probably know, there is special variable pattern {USER} filled with a list of currently logged in user details. So, we just need to specify logic rule that will check {USER[roles]} list for a specified WordPress role name. Use this rule within actions Stop if and Run another workflow. Below is an example of how to stop further execution of the workflow if a user is not an administrator. Notice that we use Not contains comparison because {USER[roles]} is a list and we need to make sure it contains a string administrator.

Stop workflow with checking role of a current user

Stop workflow with checking role of a current user

Next example is an executing another workflow conditionally if a current user has an administrator or editor role.

Run another workflow conditionally

Run another workflow conditionally

No Comments

Sorry, the comment form is closed at this time.