fbpx
Share on facebook
Share on twitter
Share on linkedin

PHP tricks for Join.chat

How to customize Join.chat using PHP filters

Change the look and feel of Join.chat by adding some PHP filters in the theme’s functions.php or by using the plugin Code Snippets


βšͺ️ Glass effect chat window

function joinchat_chatbox_blur( $classes ) {
    return $classes . ' joinchat--blur';
}
add_filter( 'joinchat_classes', 'joinchat_chatbox_blur' );

🌟 Always display the tooltip

function joinchat_always_tooltip() {
 ?>
<script>
jQuery(document).on('joinchat:start', function () {
    setTimeout( function () { joinchat_obj.$div.addClass('joinchat--tooltip'); }, joinchat_obj.settings.button_delay * 1000 );
});
</script>
 <?php
}
add_action( 'wp_footer', 'joinchat_always_tooltip', 20 );

πŸ”’ Show only for logged-in users

function joinchat_only_for_logged( $show ) {
    return $show && is_user_logged_in();
}
add_filter( 'joinchat_show', 'joinchat_only_for_logged' );

πŸ›¬ Show only for guest users

function joinchat_only_for_guests( $show ) {
    return $show && ! is_user_logged_in();
}
add_filter( 'joinchat_show', 'joinchat_only_for_guests' );

By using this website, you accept our cookie policy