Changeset 46322
- Timestamp:
- 09/26/2019 01:52:46 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/plugin.php
r46220 r46322 440 440 * functions hooked to the action. Default empty. 441 441 */ 442 function do_action( $tag, $arg = '') {442 function do_action( $tag, ...$arg ) { 443 443 global $wp_filter, $wp_actions, $wp_current_filter; 444 444 … … 449 449 } 450 450 451 $all_args = func_get_args();452 453 451 // Do 'all' actions first 454 452 if ( isset( $wp_filter['all'] ) ) { 455 453 $wp_current_filter[] = $tag; 454 $all_args = func_get_args(); 456 455 _wp_call_all_hook( $all_args ); 457 456 } … … 468 467 } 469 468 470 $args = $all_args; 471 array_shift( $args ); 472 473 if ( empty( $args ) ) { 474 $args = array( '' ); 475 } 476 477 $wp_filter[ $tag ]->do_action( $args ); 469 if ( empty( $arg ) ) { 470 $arg[] = ''; 471 } 472 473 $wp_filter[ $tag ]->do_action( $arg ); 478 474 479 475 array_pop( $wp_current_filter );
Note: See TracChangeset
for help on using the changeset viewer.