Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress check user against user roles

$user = wp_get_current_user();
if ( in_array( 'author', (array) $user->roles ) ) {
    //The user has the "author" role
}
 
PREVIOUS NEXT
Tagged: #wordpress #check #user #user #roles
ADD COMMENT
Topic
Name
5+7 =