Make WordPress Core


Ignore:
Timestamp:
10/07/2025 01:23:00 AM (24 hours 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-categories.php

    r56748 r60909  
    109109
    110110            <?php
    111             wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );
     111            wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) . "\n//# sourceURL=" . rawurlencode( __METHOD__ ) );
    112112        } else {
    113113            $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml';
Note: See TracChangeset for help on using the changeset viewer.