Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Last active October 12, 2021 11:07
Show Gist options
  • Save webtoffee-git/74a4abf1ba3ccd18367b5721e3bf0662 to your computer and use it in GitHub Desktop.
Save webtoffee-git/74a4abf1ba3ccd18367b5721e3bf0662 to your computer and use it in GitHub Desktop.
To modify the functionality of shortcode [cookie_close] from 'Accept' to just 'Close' - CookieYes | GDPR Cookie Consent (Free & Pro)
<?php // do not copy this line
// To modify the [cookie_close] functionality - CookieYes | GDPR Cookie Consent
function wt_cli_custom_close_action () {
if (!class_exists('Cookie_Law_Info'))
return;
?>
<script>
jQuery(function ($) {
$('.cli_cookie_close_button').attr('title', 'Close');
$('.cli_cookie_close_button').off('click').on('click', function(e) {
CLI.hidePopupOverlay();
if(CLI.settings.notify_animate_hide) {
CLI.bar_elm.slideUp( CLI.settings.animate_speed_hide );
}else {
CLI.bar_elm.hide();
}
if(CLI.settings.showagain_tab) {
CLI.showagain_elm.slideDown( CLI.settings.animate_speed_show );
}
return false;
});
});
</script>
<?php
}
add_action('wp_footer', 'wt_cli_custom_close_action');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment