Simple Ajax Chat Pro (SAC Pro) chat forms strive for simplicity. So extra details like user roles are not displayed in the chat box. But there are scenarios where it makes sense to display extra information. For such cases, this tutorial shows how to display the user role next to each chat message. You can enable it for all chat forms or just for specific forms only.

Tip: Just getting started with SAC Pro? Check out the Quick Start Guide »

Display User Role

To get a better idea of how user roles are displayed on chat forms, check out the screenshot below.

To display user roles on all forms (globally), visit the SAC Pro settings ▸ General ▸ “Display User Role”.

To enable user roles for a specific form, add the display_meta attribute to the [sacpro] shortcode:

[sacpro form_id="123" display_meta="true"]

The display_meta attribute accepts either true or false.

Note: logged-in users will show their registered user role next to messages. Non-logged user roles will show as “visitor”.

More attributes to customize your chat forms can be found in the SAC Pro shortcode reference.

Tip: You can display user avatars and message dates on any chat box.

Screenshot

Here is what the chat form looks like with user roles displayed next to messages. Click image for full-size view.

Screenshot showing chat box with user roles displayedScreenshot showing chat box with user role displayed next to each chat name. WordPress theme: Twenty Sixteen. Chat theme: Hero. (click to view full size)