Last active
May 11, 2018 08:00
-
-
Save cubehrends/1f316da01358e85f3592742327f0d83a to your computer and use it in GitHub Desktop.
GDPR Consented Loading from GitHub for WordPress Page Builders like Divi, Elementor, Gutenberg etc. Learn more at https://webdevtrust.com/gdpr-consent-loading-page-builder/
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
<script id="gist0"> | |
(function( $ ) { | |
if ( has_consent( 'github' ) ){ | |
$.getJSON( 'https://gist.github.com/cubehrends/1f316da01358e85f3592742327f0d83a.json?callback=?', function( data ) { | |
$('#gist0').parent().html( $( data.div ) ).append('<link rel="stylesheet" href="' + data.stylesheet + '">') | |
} ) | |
} else { | |
$('#gist0').parent().html('<p align="center"><strong>You have not given consent to load from GitHub.</strong></p>') | |
} | |
})( jQuery ) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment