I need to retrieve the id of a role by giving it roles name.
For example:
if( current_user_can('editor') ) {
//here I want to retrieve the id of editor.
}
How can I do that?
I need to retrieve the id of a role by giving it roles name.
For example:
if( current_user_can('editor') ) {
//here I want to retrieve the id of editor.
}
How can I do that?
You must be logged in to post a comment.
Try buildin function get_users. The code should be like that: