Wordpress script with integrity and crossorigin

前端 未结 7 1178
旧时难觅i
旧时难觅i 2021-02-03 12:07

I\'m trying to use the wp_register_script and wp_enqueue_script FUNCTION on WordPress to enqueue a script, which has two attributes: \"integrity\" and \"crossorigin\".

N

7条回答
  •  北荒
    北荒 (楼主)
    2021-02-03 12:33

    This is the correct syntax:

    
    

    "integrity" and "crossorgin" are not part of the URL. They are part of the script tag.

    Unfortunately Wordpress can not handle attributes on enqueued scripts at the moment.
    But they working on it... Status: needs-testing :-)
    => Ticket 22249 / Wordpress Core

提交回复
热议问题