Created
March 4, 2021 05:55
-
-
Save wtmujeebu/b3797b2e7651bfc1f77a538d93d21aa3 to your computer and use it in GitHub Desktop.
Dequeue GDPR cookie consent script by WebToffee
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 | |
function move_gdpr_script() { | |
if (class_exists('Cookie_Law_Info')) { | |
if (!is_admin()) { | |
wp_dequeue_script('cookie-law-info'); | |
wp_enqueue_script('cookie-law-info', '', array('jquery'), false, true); | |
wp_dequeue_script('cookie-law-info-ccpa'); | |
wp_enqueue_script('cookie-law-info-ccpa', '', array('jquery', 'cookie-law-info'), false, true); | |
} | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'move_gdpr_script', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment