[wp-trac] [WordPress Trac] #63413: Unused global variables declared in wp_enqueue_registered_block_scripts_and_styles

WordPress Trac noreply at wordpress.org
Thu May 8 08:56:11 UTC 2025


#63413: Unused global variables declared in
wp_enqueue_registered_block_scripts_and_styles
------------------------------+--------------------------------------------
 Reporter:  umesh.nevase      |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  General           |     Version:  6.8
 Severity:  normal            |  Resolution:
 Keywords:  has-patch needs-  |     Focuses:  performance, coding-standards
  testing                     |
------------------------------+--------------------------------------------

Comment (by b1ink0):

 After looking at the file history, I found that in
 [#537](https://github.com/WordPress/wordpress-develop/pull/537) the
 `_should_load_block_editor_scripts_and_styles()` helper was introduced and
 the screen-check logic was moved into it. However, the `global
 $current_screen;` declaration in
 `wp_enqueue_registered_block_scripts_and_styles()` was left behind. Since
 the function no longer uses `$current_screen`, this global could probably
 be removed.

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


More information about the wp-trac mailing list