Created
February 19, 2024 18:19
-
-
Save pacotole/4f1aa6f7467487a2924232e544343a31 to your computer and use it in GitHub Desktop.
Joinchat always show Chat Window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Snippet 1: Set current CTA always as "not viewed". | |
* Chat Window will show with your Joinchat settings. | |
*/ | |
add_filter( 'joinchat_get_settings', function( $settings, $obj ) { | |
$settings['is_viewed'] = false; | |
return $settings; | |
}, 10, 2 ); | |
/** | |
* Snippet 2: Set current CTA if condition as "not viewed". | |
* Chat Window will show with your Joinchat settings. | |
*/ | |
add_filter( 'joinchat_get_settings', function( $settings, $obj ) { | |
if ( is_home() ) $settings['is_viewed'] = false; // Always at home page | |
if ( is_page( 'contact' ) ) $settings['is_viewed'] = false; // Always at contact page | |
if ( is_page( array( 34, 56) ) ) $settings['is_viewed'] = false; // Always at pages with IDs | |
return $settings; | |
}, 10, 2 ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment