[wp-trac] [WordPress Trac] #58208: `wp_enqueue_registered_block_scripts_and_styles` is called twice

WordPress Trac noreply at wordpress.org
Fri Apr 28 08:49:17 UTC 2023


#58208: `wp_enqueue_registered_block_scripts_and_styles` is called twice
--------------------------+------------------------
 Reporter:  oandregal     |       Owner:  oandregal
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  6.3
Component:  Editor        |     Version:  5.0
 Severity:  normal        |  Resolution:  fixed
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------
Changes (by oandregal):

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


Comment:

 In [changeset:"55695" 55695]:
 {{{
 #!CommitTicketReference repository="" revision="55695"
 Enqueue registered assets once.

 This PR removes the `wp_enqueue_registered_block_scripts_and_styles`
 callback from the `enqueue_block_editor_assets` action.

 There are two actions to enqueue block assets:
 `enqueue_block_editor_assets` and `enqueue_block_assets`. The former
 enqueues the assets to the editor and the later enqueues them to the
 front-end and the editor. Given
 `wp_enqueue_registered_block_scripts_and_styles` is already bound to the
 `enqueue_block_assets` (front-end and editor), it is unnecessary to bind
 it to `enqueue_block_editor_assets` (editor) as well.

 This was originally introduced at [44157] and hasn't been modified since.

 Props ellatrix, costdev.
 Fixes #58208.
 }}}

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


More information about the wp-trac mailing list