
1,039Download
Messages can be sent, received, and shared among all logged-in users.
Specification
Date | Compatible version | Links |
---|---|---|
Author: Katsushi Kawamori
Last Updated: 2 weeks ago
Release: 2022-11-01
|
PHP: 7.0
WordPress: 5.0
Tested up to: 6.2
|
Description
Contents
Messenger
- All logged in users post and display messages.
- The default number of items displayed is 100; if more than 100 items are displayed, they are erased in order of oldest to newest. This can be changed with the following filter.
- The default user permission is “read”, so all users can use it. This can be changed with the following filter.
- The display is updated at 1-second intervals. This can be changed with the following filter.
Notifies
- Notify unread messages in a modal window at 60 second intervals. This can be changed with the following filter.
Title
- The default title is “All Users Messenger”. This can be changed with the following filter.
How it works
Filter hooks
- The number of messages displayed can be customized. The default is 100 messages.
/** ==================================================
* Number of messages displayed filter. Default 100.
*
*/
add_filter( 'all_users_messenger_messages_max', function(){ return 200; }, 10, 1 );
- Usage permission filter. Default is read.
/** ==================================================
* Capability filter for use. Deafult read.
*
*/
add_filter( 'all_users_messenger_capability', function(){ return 'edit_post'; }, 10, 1 );
- The interval between message displays can be customized. The default is 1 second.
/** ==================================================
* Message display interval filter. Default 1 sec.
*
*/
add_filter( 'all_users_messenger_interval', function(){ return 2; }, 10, 1 );
- The unread check interval for displaying unread messages in the modal window in the administration screen. The default is 60 seconds.
/** ==================================================
* Notification unread messages interval seconds filter for modal windows. Default 60 sec.
*
*/
add_filter( 'all_users_messenger_notify_interval', function(){ return 120; }, 10, 1 );
- This is the filter for the menu title. The default is “All Users Messenger”.
/** ==================================================
* Menu tite filter. Default All Users Messenger.
*
*/
add_filter( 'all_users_messenger_page_title', function(){ return 'Chat'; }, 10, 1 );
add_filter( 'all_users_messenger_menu_title', function(){ return 'Chat'; }, 10, 1 );
- This is filter for display modal window. The default is True.
/** ==================================================
* Display to the modal window filter. Default True.
*
*/
add_filter( 'all_users_messenger_modal_view', function(){ return false; }, 10, 1 );
Action hooks
- This deletes all messages.
/** ==================================================
* Delete all messages.
*
*/
do_action( 'all_users_messenger_clear_messages' );