Move admin scripts to the footer in GDPR Cookie Consent

Move admin scripts to the footer in GDPR Cookie Consent on child sites.

Snippet Type

Execute on Child Sites

Snippet

function wt_move_gdpr_script_to_footer() {
	if (class_exists('Cookie_Law_Info')) {
		wp_dequeue_script('cookie-law-info');
		wp_enqueue_script('cookie-law-info', '', array(), false, true);
	}
}
add_action( 'admin_enqueue_scripts', 'wt_move_gdpr_script_to_footer', 999 );
1 Like