Repository navigation
Multisite: Use nowdocs for network admin inline scripts - #16304
shail-mehta wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The Multisite inline-script migration has no active review issues.
No open issues 🎉
What changed in this PR
Updates two Multisite network admin functions to emit inline JavaScript through wp_print_inline_script_tag() using nowdocs, addressing Trac #66856.
Changes:
- Converts the language-install spinner script to a static nowdoc without changing its behavior.
- Converts the Thickbox loading-image setup to a nowdoc function, passing the path through JSON encoding instead of
esc_js().
| File | Description |
|---|---|
src/wp-admin/includes/ms.php |
Migrates both inline scripts to nowdocs and the script-tag helper. |
Review effort: Balanced
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
mukeshpanchal27
left a comment
There was a problem hiding this comment.
LGTM. tb_pathToImage now goes through wp_json_encode() only, so nothing is escaped twice, and thickbox.js still finds it on window.
What
Trac ticket: #66856
Migrates
_thickbox_path_admin_subfolder()andnetwork_settings_add_js()insrc/wp-admin/includes/ms.phpfrom raw script tags towp_print_inline_script_tag()with<<<'JS'nowdocs.Why
#66856 lists both functions. A nowdoc lets the IDE highlight the JS. The helper is required when removing the raw script tag.
How
network_settings_add_js(): static JS nowdoc. Unchanged except indentation._thickbox_path_admin_subfolder(): nowdoc function; path passed withwp_json_encode( …, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES )instead ofesc_js()inside the script.Testing Instructions
php -l src/wp-admin/includes/ms.phpUse of AI Tools