Instead of manually constructing the markup for `SCRIPT` tags, leverage `wp_print_inline_script_tag()` when available to do the construction while also ensuring filters may inject additional attributes on the `SCRIPT` tags, such as `nonce` for CSP. When the function is not available (prior to WP 5.7), fall back to the manual markup construction. This also adds the `sourceURL` comments to the inline scripts to facilitate debugging, per #63887. Developed in https://github.com/WordPress/wordpress-develop/pull/9416. Follow-up to [60909], [60899]. Props debarghyabanerjee, westonruter, hbhalodia, peterwilsoncc, sabernhardt, poena. See #63887, #59446. Fixes #63806. Built from https://develop.svn.wordpress.org/trunk@60913 git-svn-id: http://core.svn.wordpress.org/trunk@60249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
38 KiB
38 KiB