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' );

🍪 We use cookies to personalize and enhance your experience on our site. Visit our Privacy Policy to learn more.

BY USING OUR SITE, YOU AGREE TO OUR USE OF COOKIES.