Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
how can i show user's role in comment form near their name?!!
for example when admin reply a comment i want to show "admin" word near admin name
or when a user buy a product from my site and send a comment i want to show "buyer" role in near name
This will print User Role
$user_role = $current_user->roles;
Use above code, where ever you want to display user role.
Required, but never shown