Make WordPress Core


Ignore:
Timestamp:
08/28/2025 07:54:21 AM (6 months ago)
Author:
jonsurrell
Message:

Script Loader: Add sourceURL to inline scripts and styles.

Improve the source locations referenced by developer tooling in supporting browsers. Inline source locations are named like inline:handle-js-after and appear in the developer tools "sources" panel.

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

Props jonsurrell, swissspidy, alshakero, westonruter.
Fixes #63887.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-styles.php

    r58878 r60685  
    337337            return false;
    338338        }
     339
     340        $output[] = sprintf(
     341            '/*# sourceURL=inline:%s */',
     342            rawurlencode( "{$handle}-inline-css" )
     343        );
    339344
    340345        $output = implode( "\n", $output );
Note: See TracChangeset for help on using the changeset viewer.