wp role exists

Checks if a role exists.

Exits with return code 0 if the role exists, 1 if it does not.

Synopsis

wp role exists <role-key>

Options


The internal name of the role.

Examples

# Check if a role exists
$ wp role exists editor
Success: Role with ID 'editor' exists.