[wp-trac] [WordPress Trac] #49678: do_action default first parameter

WordPress Trac noreply at wordpress.org
Sun Mar 22 18:55:26 UTC 2020


#49678: do_action default first parameter
--------------------------+-----------------------------
 Reporter:  Tkama         |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.3.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This code looks like bug: we don't pass any parameters to action but the
 first parameter is passed anyway and have the value '' (empty string).
 Why?

 {{{#!php
 <?php
 add_action( 'action_name', function( $first ){
         var_dump( $first );
 } );

 do_action( 'action_name' ); //> string(0) ""
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49678>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list