Make WordPress Core


Ignore:
Timestamp:
10/07/2025 01:23:00 AM (2 months ago)
Author:
westonruter
Message:

Script Loader: Add sourceURL comments to inline SCRIPT tags manually constructed in wp-includes.

This applies to tags constructed without wp_get_inline_script_tag()/wp_print_inline_script_tag().

Developed in https://github.com/WordPress/wordpress-develop/pull/9955.

Props westonruter, jonsurrell.
See #63887.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-selective-refresh.php

    r60681 r60909  
    194194
    195195        // Export data to JS.
    196         wp_print_inline_script_tag( sprintf( 'var _customizePartialRefreshExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) );
     196        wp_print_inline_script_tag( sprintf( 'var _customizePartialRefreshExports = %s;', wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
    197197    }
    198198
Note: See TracChangeset for help on using the changeset viewer.