Make WordPress Core

Changeset 64496


Ignore:
Timestamp:
10/19/2026 05:56:25 AM (5 weeks ago)
Author:
jonsurrell
Message:

Script Loader: Document wp_inline_script_attributes $data parameter quirk.

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

Props jonsurrell, westonruter.
See #65860, #66308.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r64485 r64496  
    35893589         * Filters attributes to be added to a script tag.
    35903590         *
     3591         * Escaping and normalization can make the text a browser parses from the printed tag differ
     3592         * from `$data`. A callback that needs that text, such as one computing a CSP hash, can set
     3593         * `$data` as the modifiable text of a SCRIPT tag in a `WP_HTML_Tag_Processor` with the
     3594         * filtered attributes applied and then read {@see WP_HTML_Tag_Processor::get_modifiable_text()},
     3595         * at a late priority so that the attributes are final.
     3596         *
    35913597         * @since 5.7.0
    35923598         *
Note: See TracChangeset for help on using the changeset viewer.