Private Chat button feature
The feature is about opening a private (1-on-1) chat window in Wise Chat Pro as a result of clicking a custom link located somewhere else on the page. In the example below: user clicks Chat Message button and a chat window gets displayed. It is ready to send direct messages to the user.
BuddyPress setup
BuddyPress setup is easier because there is no need to create the button manually. Follow these simple steps do output Chat Message button on every profile page.
- First, you need to enable BuddyPress integration. It is enabled by default in a fresh installation, but in case you disabled it: go to
Settings
/Wise Chat Pro Settings
page and clickGeneral
tab. Then enableEnable BuddyPress
option - Set to display Chat Message button on member’s profile page: go to
Settings
/Wise Chat Pro Settings
page and clickAppearance
tab. Then enableShow Chat Button On Member Profile
option. - Go to a member’s profile page and click Chat Message button to open the direct chat window. This is the place you can send messages directly to the user. You may consider setting notifications so the recipient gets notified while being offline.
- If you visit your own profile then no button will be visible.
- Customize options on Wise Chat Pro Settings page.
- User you have just sent a direct message to is now able to receive it using Chat link in the header:
Custom setup via shortcode
Custom setup requires a minimal knowledge of WordPress.
1. Select or create a page (or post) where you want to add Chat Message link. The link will open a private chat window to specific user. Find the ID number of that user and use it in the next step. In order to find the ID please go to Users page of WordPress Dashboard. Click on the name of the desired user. A number you see in the address bar of the browser is the ID:
2. Add the following shortcode:
[wise-chat-button to="2" label="Chat Message"]
Required attributes:
- to – this is the ID of the user that the chat will open a direct chat window to
- label – the text label of the link
Optional attributes:
- class – class name applied to <a> element
3. Users may check received messages using Chat link in the header. Please consider enabling chat notifications.
PHP approach
Make use of do_shortcode() function if you plan to add the chat button using PHP.
echo do_shortcode( '[wise-chat-button to="2" label="Chat Message"]' );