Copy and share the post with shorten link: https://wp.me/p4Ams0-he
Get logged in user assigned roles. Use function wp_get_current_user() to get the current/logged in user info.
print_r( prefix_get_current_user_roles() );
//  => administrator
This site uses Akismet to reduce spam. Learn how your comment data is processed.