Skip to content

Instantly share code, notes, and snippets.

@cuxaro
Created January 17, 2022 20:55
Show Gist options
  • Save cuxaro/fb9b2f0a12ef754c504410c0c19da301 to your computer and use it in GitHub Desktop.
Save cuxaro/fb9b2f0a12ef754c504410c0c19da301 to your computer and use it in GitHub Desktop.
hooks GDPR WordPress
<?php
add_action('init', function () {
if (function_exists('gdpr_cookie_is_accepted')) :
if (gdpr_cookie_is_accepted('thirdparty')) :
//Aquí va el código a ejecutar
endif;
endif;
});
function ib_gdpr_prevent_script_cache()
{
return array();
}
add_filter('gdpr_cookie_script_cache', 'ib_gdpr_prevent_script_cache');
add_action('gdpr_force_reload', '__return_true');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment