Echo User Role WordPress PHP


$user = new WP_User( $user->ID );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
foreach ( $user->roles as $role )
echo ucfirst($role);
}


  • No Comments

    Post a Comment