Solution for "user role wordpress"

$user_meta = get_userdata( $user_id ); $user_roles = $user_meta->roles; // array with all the roles the user is part of.

from user id to user role wordpress

$wp_user_object = new WP_User($current_user->ID); $wp_user_object->set_role('editor');

update user role wordpress

Similar codes for "user role wordpress"


Latest 'PHP' questions

Added before "user role wordpress"