[wp-trac] [WordPress Trac] #59132: Create two filters in wp_scripts() and wp_styles().

WordPress Trac noreply at wordpress.org
Thu Aug 17 19:31:43 UTC 2023


#59132: Create two filters in wp_scripts() and wp_styles().
-------------------------------+------------------------------
 Reporter:  salvio             |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Script Loader      |     Version:  trunk
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:  javascript, css
-------------------------------+------------------------------
Changes (by hellofromTonya):

 * keywords:   => reporter-feedback


Comment:

 Hello @salvio,

 Welcome to WordPress Core's Trac!

 I wonder .. could you instead replace the global `$wp_scripts` at either
 `init` or when your plugin loads? The global is available for use,
 including being overwritten. If your custom class extends `WP_Scripts`
 class, then when `wp_scripts()` is called, it will use the custom instance
 in the global.

 What do you think?

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


More information about the wp-trac mailing list