Repository navigation
Embed: Use a nowdoc for the oEmbed cache request script - #16313
shail-mehta wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the oEmbed cache script’s migration to WordPress’s inline-script helper.
No open issues 🎉
What changed in this PR
Updates WP_Embed::maybe_run_ajax_cache() to use WordPress’s inline-script helper instead of a raw <script> block, addressing the remaining block identified in ticket #66856.
Changes:
- Moves the static JavaScript into a nowdoc function.
- Passes the AJAX URL and post ID through
wp_json_encode(). - Prints the script with
wp_print_inline_script_tag(), retaining the document-ready cache request.
| File | Description |
|---|---|
src/wp-includes/class-wp-embed.php |
Converts the oEmbed cache request script to nowdoc-based output through the inline-script 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. The URL matches the old one, and the script still prints on edit_form_advanced and edit_page_form.
What
Trac Ticket: #66856
Print the oEmbed cache request script in
WP_Embed::maybe_run_ajax_cache()throughwp_print_inline_script_tag()and a NOWDOC wrapper.Why
This is the remaining raw script-tag block listed for
wp-includes/class-wp-embed.php.How
The static JS is a nowdoc function. The
admin-ajax.phpURL with the post ID is passed withwp_json_encode().Testing Instructions
?message=...) as an admin.admin-ajax.php?action=oembed-cache&post=ID.Use of AI tools