Make WordPress Core

Changes between Version 17 and Version 18 of Ticket #58873


Ignore:
Timestamp:
08/24/2026 05:33:14 PM (7 weeks ago)
Author:
jonsurrell
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58873 – Description

    v17 v18  
    55== Proposal ==
    66
    7 Add the same filter to `WP_Scripts`. Before printing a script's localized data, translations, and inline scripts, apply a `script_data_{$handle}` filter. If it returns a non-empty array, print it as a JSON script tag with an ID the script can look up, such as `wp-script-data-{$handle}`.
     7Add the same filter to `WP_Scripts`. Before printing a script's localized data, translations, and inline scripts, apply a `script_client_data_{$handle}` filter. If it returns a non-empty array, print it as a JSON script tag with an ID the script can look up, such as `wp-script-client-data-{$handle}`.
    88
    99Follow the Script Modules implementation in `WP_Script_Modules::print_script_module_data()`, including its JSON encoding flags and charset handling.