Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active January 14, 2022 04:55
Show Gist options
  • Save webtoffee-git/bf1d3e5f3f0e850f8b73e129be797834 to your computer and use it in GitHub Desktop.
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/)
<?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