Skip to main content

better_messages_realtime_event

Receives custom realtime events, which sent via WebSocket servers

To send events which will trigger this JavaScript hook use send_realtime_event PHP Function

REQUIREMENTS

To be able to implement this guide, you need to learn how to use JS snippets at your website.

One of guides: https://dev.to/david_woolf/how-to-get-started-with-wordpress-hooks-in-javascript-400o

Compatibility
This hook compatible with Better Messages 2.0.62 or higher
WebSocket Version Guide
This functionality available only with WebSocket Version
wp.hooks.addAction('better_messages_realtime_event', 'my_custom_actions', function (eventData) {
// Here you can get the data which you send with PHP function and trigger custom action
console.log( eventData );

alert( 'data received', JSON.stringify(eventData) )
})