Last active
January 14, 2022 04:55
-
-
Save webtoffee-git/bf1d3e5f3f0e850f8b73e129be797834 to your computer and use it in GitHub Desktop.
To modify the [cookie_close] functionality as reject - CookieYes | GDPR Cookie Consent (https://wordpress.org/plugins/cookie-law-info/)
This file contains 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 //do not copy this line | |
/** | |
* To modify the [cookie_close] functionality as reject - CookieYes | GDPR Cookie Consent | |
*/ | |
function wt_cli_custom_close () { | |
if (!class_exists('Cookie_Law_Info')) | |
return; | |
$title = __( 'Close and Reject', 'webtoffee-gdpr-cookie-consent' ); | |
// $title = __( 'Close and Reject', 'cookie-law-info' ); | |
?> | |
<script> | |
jQuery(function ($) { | |
$('.cli_cookie_close_button').attr('title', '<?php echo $title;?>'); | |
$('.cli_cookie_close_button').off('click').on('click', function(e) { | |
CLI.disableAllCookies(); | |
CLI.reject_close(); | |
return false; | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_footer', 'wt_cli_custom_close'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment