mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Plugins: Restore backward compatibility for PHP4-style passing of array( &$this ) as action argument to do_action().
This is a follow-up to [46149] to avoid unnecessary breakage in case of using the old notation. Props david.binda, jrf. Reviewed by azaozz. Fixes #48312. git-svn-id: https://develop.svn.wordpress.org/trunk@46568 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -470,6 +470,9 @@ function do_action( $tag, ...$arg ) {
|
||||
|
||||
if ( empty( $arg ) ) {
|
||||
$arg[] = '';
|
||||
} elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
|
||||
// Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
|
||||
$arg[0] = $arg[0][0];
|
||||
}
|
||||
|
||||
$wp_filter[ $tag ]->do_action( $arg );
|
||||
|
||||
Reference in New Issue
Block a user