[wp-trac] [WordPress Trac] #40485: Add function for retrieving metadata from registered script

WordPress Trac noreply at wordpress.org
Wed Aug 13 13:37:33 UTC 2025


#40485: Add function for retrieving metadata from registered script
-------------------------------------------------+-------------------------
 Reporter:  desrosj                              |       Owner:  (none)
     Type:  feature request                      |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  Script Loader                        |     Version:  4.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing reporter-feedback                      |
-------------------------------------------------+-------------------------
Changes (by jonsurrell):

 * keywords:  has-patch has-unit-tests needs-testing => has-patch has-unit-
     tests needs-testing reporter-feedback


Comment:

 The proposal seems reasonable and aligns with the way many other singleton
 classes have global functions to wrap methods on the singleton instance,
 so there's precedent.

 The proposed function in the patch wraps `wp_scripts()->get_data( $handle,
 $key );`.

 Are there policies or precedents for when these functions should or should
 not be added? It's worth considering that there's been little apparent
 interest in the 8 years since the ticket was created.

 @desrosj do you still want to move ahead with this?

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


More information about the wp-trac mailing list