Contents
You created an element on your website with Breakdance, but then realized that two files named gsap.min.js and ScrollTrigger.min.js be loaded from an external domain? This can be problematic from a GDPR perspective. In this tutorial, we will show you how to load these files locally.
1. download files
First download these 2 files and upload them to your server via FTP. For example, you could create a folder in your WordPress installation.
/wp-content/custom-files/
2. add code
Now the uploaded files must be loaded via a PHP script. Normally you use the functions.php of the current theme for this. Since Breakdance is usually used without a theme, we need a different solution for the code. It is best to use a plugin like WP Code. Here you can add the following PHP code:
add_action('breakdance_reusable_dependencies_urls', function ($urls) {
$urls['gsap'] = '/wp-content/custom-files/gsap.min.js';
$urls['scrollTrigger'] = '/wp-content/custom-files/ScrollTrigger.min.js';
return $urls;
});
Conclusion!
That's it! Now the 2 files are loaded locally.