Update WP and plugins
This commit is contained in:
parent
10a4713229
commit
1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions
|
@ -71,12 +71,12 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
|||
* @param int $accepted_args The number of arguments the function accepts.
|
||||
*/
|
||||
public function add_filter( $tag, $function_to_add, $priority, $accepted_args ) {
|
||||
$idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority );
|
||||
$idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority );
|
||||
$priority_existed = isset( $this->callbacks[ $priority ] );
|
||||
|
||||
$this->callbacks[ $priority ][ $idx ] = array(
|
||||
'function' => $function_to_add,
|
||||
'accepted_args' => $accepted_args
|
||||
'function' => $function_to_add,
|
||||
'accepted_args' => $accepted_args,
|
||||
);
|
||||
|
||||
// if we're adding a new priority to the list, put them back in sorted order
|
||||
|
@ -243,7 +243,7 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
|||
|
||||
if ( false === $priority ) {
|
||||
$this->callbacks = array();
|
||||
} else if ( isset( $this->callbacks[ $priority ] ) ) {
|
||||
} elseif ( isset( $this->callbacks[ $priority ] ) ) {
|
||||
unset( $this->callbacks[ $priority ] );
|
||||
}
|
||||
|
||||
|
@ -269,14 +269,14 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
|||
$nesting_level = $this->nesting_level++;
|
||||
|
||||
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
|
||||
$num_args = count( $args );
|
||||
$num_args = count( $args );
|
||||
|
||||
do {
|
||||
$this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );
|
||||
|
||||
foreach ( $this->callbacks[ $priority ] as $the_ ) {
|
||||
if( ! $this->doing_action ) {
|
||||
$args[ 0 ] = $value;
|
||||
if ( ! $this->doing_action ) {
|
||||
$args[0] = $value;
|
||||
}
|
||||
|
||||
// Avoid the array_slice if possible.
|
||||
|
@ -285,7 +285,7 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
|||
} elseif ( $the_['accepted_args'] >= $num_args ) {
|
||||
$value = call_user_func_array( $the_['function'], $args );
|
||||
} else {
|
||||
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
|
||||
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
|
||||
}
|
||||
}
|
||||
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
|
||||
|
@ -323,7 +323,7 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
|||
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
|
||||
*/
|
||||
public function do_all_hook( &$args ) {
|
||||
$nesting_level = $this->nesting_level++;
|
||||
$nesting_level = $this->nesting_level++;
|
||||
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
|
||||
|
||||
do {
|
||||
|
@ -356,7 +356,6 @@ final class WP_Hook implements Iterator, ArrayAccess {
|
|||
* Normalizes filters set up before WordPress has initialized to WP_Hook objects.
|
||||
*
|
||||
* @since 4.7.0
|
||||
* @static
|
||||
*
|
||||
* @param array $filters Filters to normalize.
|
||||
* @return WP_Hook[] Array of normalized filters.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue