[wp-trac] [WordPress Trac] #44632: Properly enqueue wp-embed

WordPress Trac noreply at wordpress.org
Tue Jan 4 15:22:55 UTC 2022


#44632: Properly enqueue wp-embed
-------------------------------------+-------------------------------------
 Reporter:  alpipego                 |       Owner:  audrasjb
     Type:  enhancement              |      Status:  closed
 Priority:  normal                   |   Milestone:  5.9
Component:  Embeds                   |     Version:  4.4
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch has-unit-      |     Focuses:  javascript,
  tests dev-reviewed commit          |  performance
-------------------------------------+-------------------------------------
Changes (by audrasjb):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52437" 52437]:
 {{{
 #!CommitTicketReference repository="" revision="52437"
 Embeds: Fix oEmbed host script enqueueing on block-based themes.

 This change fixes oEmbed host script enqueueing on front-end when using
 block themes.

 It deprecates `wp_oembed_add_host_js` in favor of
 `wp_maybe_enqueue_oembed_host_js`. The action is still triggered in
 `default-filters.php` to ensure backward compatibility for websites that
 are removing the action. There is now a `has_action()` check in
 `wp_maybe_enqueue_oembed_host_js()` to see if `wp_oembed_add_host_js()`
 has not been unhooked from running at the `wp_head` action.

 Follow-up to [52132], [52151], [52153], [52325].

 Props swissspidy, westonruter, flixos90, kafleg.
 Fixes #44632.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44632#comment:56>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list