[wp-trac] [WordPress Trac] #54367: Remove closure hooked to `render_block` within `enqueue_block_styles_assets()`

WordPress Trac noreply at wordpress.org
Wed Nov 3 04:03:48 UTC 2021


#54367: Remove closure hooked to `render_block` within
`enqueue_block_styles_assets()`
---------------------------+---------------------
 Reporter:  desrosj        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  5.9
Component:  Script Loader  |     Version:  5.8.1
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+---------------------

Comment (by jrf):

 Replying to [comment:2 SergeyBiryukov]:
 > Replying to [comment:1 jrf]:
 > > If it helps, I can do a scan of the complete `src` to check if any
 others may have slipped in.
 >
 > Yes, please! As noted in comment:8:ticket:54323, there are at least two
 other instances added in [51902].


 Here you go (scanned with a draft/unfinished sniff I have locally, but
 which isn't in WPCS yet):


 {{{
 FILE: src\wp-admin\edit-form-blocks.php
 --------------------------------------------------------------------------------
 FOUND 1 ERROR AFFECTING 1 LINE
 --------------------------------------------------------------------------------
  34 | ERROR | Using a closure as the callback for add_filter() is
 forbidden as
     |       | unhooking it is nearly impossible (at this time - see trac
 ticket
     |       | 46635)
 --------------------------------------------------------------------------------


 FILE: src\wp-admin\includes\class-wp-upgrader.php
 --------------------------------------------------------------------------------
 FOUND 3 ERRORS AFFECTING 3 LINES
 --------------------------------------------------------------------------------
   854 | ERROR | Using a closure as the callback for add_action() is
 forbidden
       |       | as unhooking it is nearly impossible (at this time - see
 trac
       |       | ticket 46635)
   876 | ERROR | Using a closure as the callback for add_action() is
 forbidden
       |       | as unhooking it is nearly impossible (at this time - see
 trac
       |       | ticket 46635)
  1135 | ERROR | Using a closure as the callback for add_action() is
 forbidden
       |       | as unhooking it is nearly impossible (at this time - see
 trac
       |       | ticket 46635)
 --------------------------------------------------------------------------------


 FILE: src\wp-admin\options-privacy.php
 --------------------------------------------------------------------------------
 FOUND 1 ERROR AFFECTING 1 LINE
 --------------------------------------------------------------------------------
  23 | ERROR | Using a closure as the callback for add_filter() is
 forbidden as
     |       | unhooking it is nearly impossible (at this time - see trac
 ticket
     |       | 46635)
 --------------------------------------------------------------------------------


 FILE: src\wp-admin\privacy-policy-guide.php
 --------------------------------------------------------------------------------
 FOUND 1 ERROR AFFECTING 1 LINE
 --------------------------------------------------------------------------------
  22 | ERROR | Using a closure as the callback for add_filter() is
 forbidden as
     |       | unhooking it is nearly impossible (at this time - see trac
 ticket
     |       | 46635)
 --------------------------------------------------------------------------------


 FILE: src\wp-includes\script-loader.php
 --------------------------------------------------------------------------------
 FOUND 1 ERROR AFFECTING 1 LINE
 --------------------------------------------------------------------------------
  2469 | ERROR | Using a closure as the callback for add_filter() is
 forbidden
       |       | as unhooking it is nearly impossible (at this time - see
 trac
       |       | ticket 46635)
 --------------------------------------------------------------------------------


 FILE: src\wp-includes\sitemaps\class-wp-sitemaps-renderer.php
 --------------------------------------------------------------------------------
 FOUND 1 ERROR AFFECTING 1 LINE
 --------------------------------------------------------------------------------
  256 | ERROR | Using a closure as the callback for add_filter() is
 forbidden as
      |       | unhooking it is nearly impossible (at this time - see trac
      |       | ticket 46635)
 --------------------------------------------------------------------------------
 }}}

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


More information about the wp-trac mailing list