3

Need help to understand better how to add itegrity/crossorigin through wordpress wp_enqueue_script and wp_enqueue_style?

Not sure is it possible, but as far the tutorials and pages I have found, none of them include the two in the wp_enqueue_script.

For example bootstrap 4 alpha 6.

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>

And wordpress wp_enqueue_script would look then:

wp_enqueue_script( 'bootstrap4-alpha6-js', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js', array(), '101', true );

Is there a way to add integrity and crossorigin to wp_enqueue_script? If not, what would be the work arounds?

Ollu
  • 31
  • 3

0 Answers0