Resource Integrity and Cross Origin
Add integrity and crossorigin parameters to script and link resources when the values are set via wp_script_add_data or wp_style_add_data.
by Kyle Reicks · github.com/kylereicks/wp-resource-integrity · website
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/kylereicks/wp-resource-integrity/archive/refs/heads/master.zipAdd integrity and crossorigin attributes to WordPress resources
wp_script_add_data( 'script-handle', 'integrity', 'sha384-sDc5PYnGGjKkmKOlkzS+YesGwz4SwiEm6fhX1vbXuVxeS6sSooIz0V3E7y8Gk2CB' );
wp_script_add_data( 'script-handle', 'crossorigin', 'anonymous' );
wp_style_add_data( 'style-handle', 'integrity', 'sha384-5N3soZvYZ/q8LjWj8vDk5cHod041te75qnL+79nIM6NfuSK5ZJLu5CE6nRu6kefr' );
wp_style_add_data( 'style-handle', 'crossorigin', 'anonymous' );