[wp-trac] [WordPress Trac] #58525: Create util function for getting block assets uri

WordPress Trac noreply at wordpress.org
Mon Sep 25 17:47:42 UTC 2023


#58525: Create util function for getting block assets uri
--------------------------------------+---------------------------
 Reporter:  spacedmonkey              |       Owner:  spacedmonkey
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  6.4
Component:  Editor                    |     Version:  5.5
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+---------------------------
Changes (by spacedmonkey):

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


Comment:

 In [changeset:"56683" 56683]:
 {{{
 #!CommitTicketReference repository="" revision="56683"
 Editor: Introduce get_block_asset_url Utility Function.

 This commit introduces a valuable utility function, get_block_asset_url,
 designed to simplify the retrieval of block asset URLs, such as those for
 CSS and JavaScript files. This utility eliminates redundancy in both
 register_block_script_handle and register_block_style_handle.
 Additionally, `get_block_asset_url` incorporates an early exit mechanism
 to optimize performance.

 This update includes comprehensive unit tests, covering various scenarios,
 including asset registration from core (wp-includes), themes, child
 themes, plugins, and mu-plugins.

 Props spacedmonkey, joemcgill, flixos90, gziolo.
 Fixes #58525.
 }}}

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


More information about the wp-trac mailing list