Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active January 14, 2022 04:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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