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

WordPress Trac noreply at wordpress.org
Thu Apr 27 11:28:01 UTC 2023


#58208: `wp_enqueue_registered_block_scripts_and_styles` is called twice
--------------------------+-----------------------
 Reporter:  oandregal     |      Owner:  oandregal
     Type:  defect (bug)  |     Status:  assigned
 Priority:  normal        |  Milestone:  6.3
Component:  Editor        |    Version:  5.0
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------
 This is a follow-up to #45065.

 That ticket introduced the
 `wp_enqueue_registered_block_scripts_and_styles` function and set it as a
 callback for both the `enqueue_block_editor_assets` and
 `enqueue_block_assets` actions.

 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-and and the editor.

 Given `wp_enqueue_registered_block_scripts_and_styles` is already bound to
 the `enqueue_block_assets` (front-end & editor), it is unnecessary to bind
 it to `enqueue_block_editor_assets` (editor) as well.

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


More information about the wp-trac mailing list