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/widgets/class-wp-widget-archives.php

    r56748 r60909  
    121121</script>
    122122            <?php
    123             wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
     123            wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
    124124        } else {
    125125            $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
Note: See TracChangeset for help on using the changeset viewer.