Edit File by line
/home/barbar84/www/wp-inclu...
File: class-wp-hook.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Plugin API: WP_Hook class
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
* @subpackage Plugin
[5] Fix | Delete
* @since 4.7.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Core class used to implement action and filter hook functionality.
[10] Fix | Delete
*
[11] Fix | Delete
* @since 4.7.0
[12] Fix | Delete
*
[13] Fix | Delete
* @see Iterator
[14] Fix | Delete
* @see ArrayAccess
[15] Fix | Delete
*/
[16] Fix | Delete
final class WP_Hook implements Iterator, ArrayAccess {
[17] Fix | Delete
[18] Fix | Delete
/**
[19] Fix | Delete
* Hook callbacks.
[20] Fix | Delete
*
[21] Fix | Delete
* @since 4.7.0
[22] Fix | Delete
* @var array
[23] Fix | Delete
*/
[24] Fix | Delete
public $callbacks = array();
[25] Fix | Delete
[26] Fix | Delete
/**
[27] Fix | Delete
* The priority keys of actively running iterations of a hook.
[28] Fix | Delete
*
[29] Fix | Delete
* @since 4.7.0
[30] Fix | Delete
* @var array
[31] Fix | Delete
*/
[32] Fix | Delete
private $iterations = array();
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* The current priority of actively running iterations of a hook.
[36] Fix | Delete
*
[37] Fix | Delete
* @since 4.7.0
[38] Fix | Delete
* @var array
[39] Fix | Delete
*/
[40] Fix | Delete
private $current_priority = array();
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* Number of levels this hook can be recursively called.
[44] Fix | Delete
*
[45] Fix | Delete
* @since 4.7.0
[46] Fix | Delete
* @var int
[47] Fix | Delete
*/
[48] Fix | Delete
private $nesting_level = 0;
[49] Fix | Delete
[50] Fix | Delete
/**
[51] Fix | Delete
* Flag for if we're current doing an action, rather than a filter.
[52] Fix | Delete
*
[53] Fix | Delete
* @since 4.7.0
[54] Fix | Delete
* @var bool
[55] Fix | Delete
*/
[56] Fix | Delete
private $doing_action = false;
[57] Fix | Delete
[58] Fix | Delete
/**
[59] Fix | Delete
* Hooks a function or method to a specific filter action.
[60] Fix | Delete
*
[61] Fix | Delete
* @since 4.7.0
[62] Fix | Delete
*
[63] Fix | Delete
* @param string $tag The name of the filter to hook the $function_to_add callback to.
[64] Fix | Delete
* @param callable $function_to_add The callback to be run when the filter is applied.
[65] Fix | Delete
* @param int $priority The order in which the functions associated with a particular action
[66] Fix | Delete
* are executed. Lower numbers correspond with earlier execution,
[67] Fix | Delete
* and functions with the same priority are executed in the order
[68] Fix | Delete
* in which they were added to the action.
[69] Fix | Delete
* @param int $accepted_args The number of arguments the function accepts.
[70] Fix | Delete
*/
[71] Fix | Delete
public function add_filter( $tag, $function_to_add, $priority, $accepted_args ) {
[72] Fix | Delete
$idx = _wp_filter_build_unique_id( $tag, $function_to_add, $priority );
[73] Fix | Delete
[74] Fix | Delete
$priority_existed = isset( $this->callbacks[ $priority ] );
[75] Fix | Delete
[76] Fix | Delete
$this->callbacks[ $priority ][ $idx ] = array(
[77] Fix | Delete
'function' => $function_to_add,
[78] Fix | Delete
'accepted_args' => $accepted_args,
[79] Fix | Delete
);
[80] Fix | Delete
[81] Fix | Delete
// If we're adding a new priority to the list, put them back in sorted order.
[82] Fix | Delete
if ( ! $priority_existed && count( $this->callbacks ) > 1 ) {
[83] Fix | Delete
ksort( $this->callbacks, SORT_NUMERIC );
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
if ( $this->nesting_level > 0 ) {
[87] Fix | Delete
$this->resort_active_iterations( $priority, $priority_existed );
[88] Fix | Delete
}
[89] Fix | Delete
}
[90] Fix | Delete
[91] Fix | Delete
/**
[92] Fix | Delete
* Handles resetting callback priority keys mid-iteration.
[93] Fix | Delete
*
[94] Fix | Delete
* @since 4.7.0
[95] Fix | Delete
*
[96] Fix | Delete
* @param false|int $new_priority Optional. The priority of the new filter being added. Default false,
[97] Fix | Delete
* for no priority being added.
[98] Fix | Delete
* @param bool $priority_existed Optional. Flag for whether the priority already existed before the new
[99] Fix | Delete
* filter was added. Default false.
[100] Fix | Delete
*/
[101] Fix | Delete
private function resort_active_iterations( $new_priority = false, $priority_existed = false ) {
[102] Fix | Delete
$new_priorities = array_keys( $this->callbacks );
[103] Fix | Delete
[104] Fix | Delete
// If there are no remaining hooks, clear out all running iterations.
[105] Fix | Delete
if ( ! $new_priorities ) {
[106] Fix | Delete
foreach ( $this->iterations as $index => $iteration ) {
[107] Fix | Delete
$this->iterations[ $index ] = $new_priorities;
[108] Fix | Delete
}
[109] Fix | Delete
return;
[110] Fix | Delete
}
[111] Fix | Delete
[112] Fix | Delete
$min = min( $new_priorities );
[113] Fix | Delete
foreach ( $this->iterations as $index => &$iteration ) {
[114] Fix | Delete
$current = current( $iteration );
[115] Fix | Delete
// If we're already at the end of this iteration, just leave the array pointer where it is.
[116] Fix | Delete
if ( false === $current ) {
[117] Fix | Delete
continue;
[118] Fix | Delete
}
[119] Fix | Delete
[120] Fix | Delete
$iteration = $new_priorities;
[121] Fix | Delete
[122] Fix | Delete
if ( $current < $min ) {
[123] Fix | Delete
array_unshift( $iteration, $current );
[124] Fix | Delete
continue;
[125] Fix | Delete
}
[126] Fix | Delete
[127] Fix | Delete
while ( current( $iteration ) < $current ) {
[128] Fix | Delete
if ( false === next( $iteration ) ) {
[129] Fix | Delete
break;
[130] Fix | Delete
}
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
// If we have a new priority that didn't exist, but ::apply_filters() or ::do_action() thinks it's the current priority...
[134] Fix | Delete
if ( $new_priority === $this->current_priority[ $index ] && ! $priority_existed ) {
[135] Fix | Delete
/*
[136] Fix | Delete
* ...and the new priority is the same as what $this->iterations thinks is the previous
[137] Fix | Delete
* priority, we need to move back to it.
[138] Fix | Delete
*/
[139] Fix | Delete
[140] Fix | Delete
if ( false === current( $iteration ) ) {
[141] Fix | Delete
// If we've already moved off the end of the array, go back to the last element.
[142] Fix | Delete
$prev = end( $iteration );
[143] Fix | Delete
} else {
[144] Fix | Delete
// Otherwise, just go back to the previous element.
[145] Fix | Delete
$prev = prev( $iteration );
[146] Fix | Delete
}
[147] Fix | Delete
if ( false === $prev ) {
[148] Fix | Delete
// Start of the array. Reset, and go about our day.
[149] Fix | Delete
reset( $iteration );
[150] Fix | Delete
} elseif ( $new_priority !== $prev ) {
[151] Fix | Delete
// Previous wasn't the same. Move forward again.
[152] Fix | Delete
next( $iteration );
[153] Fix | Delete
}
[154] Fix | Delete
}
[155] Fix | Delete
}
[156] Fix | Delete
unset( $iteration );
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
/**
[160] Fix | Delete
* Unhooks a function or method from a specific filter action.
[161] Fix | Delete
*
[162] Fix | Delete
* @since 4.7.0
[163] Fix | Delete
*
[164] Fix | Delete
* @param string $tag The filter hook to which the function to be removed is hooked.
[165] Fix | Delete
* @param callable $function_to_remove The callback to be removed from running when the filter is applied.
[166] Fix | Delete
* @param int $priority The exact priority used when adding the original filter callback.
[167] Fix | Delete
* @return bool Whether the callback existed before it was removed.
[168] Fix | Delete
*/
[169] Fix | Delete
public function remove_filter( $tag, $function_to_remove, $priority ) {
[170] Fix | Delete
$function_key = _wp_filter_build_unique_id( $tag, $function_to_remove, $priority );
[171] Fix | Delete
[172] Fix | Delete
$exists = isset( $this->callbacks[ $priority ][ $function_key ] );
[173] Fix | Delete
if ( $exists ) {
[174] Fix | Delete
unset( $this->callbacks[ $priority ][ $function_key ] );
[175] Fix | Delete
if ( ! $this->callbacks[ $priority ] ) {
[176] Fix | Delete
unset( $this->callbacks[ $priority ] );
[177] Fix | Delete
if ( $this->nesting_level > 0 ) {
[178] Fix | Delete
$this->resort_active_iterations();
[179] Fix | Delete
}
[180] Fix | Delete
}
[181] Fix | Delete
}
[182] Fix | Delete
return $exists;
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
/**
[186] Fix | Delete
* Checks if a specific action has been registered for this hook.
[187] Fix | Delete
*
[188] Fix | Delete
* When using the `$function_to_check` argument, this function may return a non-boolean value
[189] Fix | Delete
* that evaluates to false (e.g. 0), so use the `===` operator for testing the return value.
[190] Fix | Delete
*
[191] Fix | Delete
* @since 4.7.0
[192] Fix | Delete
*
[193] Fix | Delete
* @param string $tag Optional. The name of the filter hook. Default empty.
[194] Fix | Delete
* @param callable|false $function_to_check Optional. The callback to check for. Default false.
[195] Fix | Delete
* @return bool|int If `$function_to_check` is omitted, returns boolean for whether the hook has
[196] Fix | Delete
* anything registered. When checking a specific function, the priority of that
[197] Fix | Delete
* hook is returned, or false if the function is not attached.
[198] Fix | Delete
*/
[199] Fix | Delete
public function has_filter( $tag = '', $function_to_check = false ) {
[200] Fix | Delete
if ( false === $function_to_check ) {
[201] Fix | Delete
return $this->has_filters();
[202] Fix | Delete
}
[203] Fix | Delete
[204] Fix | Delete
$function_key = _wp_filter_build_unique_id( $tag, $function_to_check, false );
[205] Fix | Delete
if ( ! $function_key ) {
[206] Fix | Delete
return false;
[207] Fix | Delete
}
[208] Fix | Delete
[209] Fix | Delete
foreach ( $this->callbacks as $priority => $callbacks ) {
[210] Fix | Delete
if ( isset( $callbacks[ $function_key ] ) ) {
[211] Fix | Delete
return $priority;
[212] Fix | Delete
}
[213] Fix | Delete
}
[214] Fix | Delete
[215] Fix | Delete
return false;
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* Checks if any callbacks have been registered for this hook.
[220] Fix | Delete
*
[221] Fix | Delete
* @since 4.7.0
[222] Fix | Delete
*
[223] Fix | Delete
* @return bool True if callbacks have been registered for the current hook, otherwise false.
[224] Fix | Delete
*/
[225] Fix | Delete
public function has_filters() {
[226] Fix | Delete
foreach ( $this->callbacks as $callbacks ) {
[227] Fix | Delete
if ( $callbacks ) {
[228] Fix | Delete
return true;
[229] Fix | Delete
}
[230] Fix | Delete
}
[231] Fix | Delete
return false;
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
/**
[235] Fix | Delete
* Removes all callbacks from the current filter.
[236] Fix | Delete
*
[237] Fix | Delete
* @since 4.7.0
[238] Fix | Delete
*
[239] Fix | Delete
* @param int|false $priority Optional. The priority number to remove. Default false.
[240] Fix | Delete
*/
[241] Fix | Delete
public function remove_all_filters( $priority = false ) {
[242] Fix | Delete
if ( ! $this->callbacks ) {
[243] Fix | Delete
return;
[244] Fix | Delete
}
[245] Fix | Delete
[246] Fix | Delete
if ( false === $priority ) {
[247] Fix | Delete
$this->callbacks = array();
[248] Fix | Delete
} elseif ( isset( $this->callbacks[ $priority ] ) ) {
[249] Fix | Delete
unset( $this->callbacks[ $priority ] );
[250] Fix | Delete
}
[251] Fix | Delete
[252] Fix | Delete
if ( $this->nesting_level > 0 ) {
[253] Fix | Delete
$this->resort_active_iterations();
[254] Fix | Delete
}
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
/**
[258] Fix | Delete
* Calls the callback functions that have been added to a filter hook.
[259] Fix | Delete
*
[260] Fix | Delete
* @since 4.7.0
[261] Fix | Delete
*
[262] Fix | Delete
* @param mixed $value The value to filter.
[263] Fix | Delete
* @param array $args Additional parameters to pass to the callback functions.
[264] Fix | Delete
* This array is expected to include $value at index 0.
[265] Fix | Delete
* @return mixed The filtered value after all hooked functions are applied to it.
[266] Fix | Delete
*/
[267] Fix | Delete
public function apply_filters( $value, $args ) {
[268] Fix | Delete
if ( ! $this->callbacks ) {
[269] Fix | Delete
return $value;
[270] Fix | Delete
}
[271] Fix | Delete
[272] Fix | Delete
$nesting_level = $this->nesting_level++;
[273] Fix | Delete
[274] Fix | Delete
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
[275] Fix | Delete
$num_args = count( $args );
[276] Fix | Delete
[277] Fix | Delete
do {
[278] Fix | Delete
$this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
[279] Fix | Delete
$priority = $this->current_priority[ $nesting_level ];
[280] Fix | Delete
[281] Fix | Delete
foreach ( $this->callbacks[ $priority ] as $the_ ) {
[282] Fix | Delete
if ( ! $this->doing_action ) {
[283] Fix | Delete
$args[0] = $value;
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
// Avoid the array_slice() if possible.
[287] Fix | Delete
if ( 0 == $the_['accepted_args'] ) {
[288] Fix | Delete
$value = call_user_func( $the_['function'] );
[289] Fix | Delete
} elseif ( $the_['accepted_args'] >= $num_args ) {
[290] Fix | Delete
$value = call_user_func_array( $the_['function'], $args );
[291] Fix | Delete
} else {
[292] Fix | Delete
$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
[293] Fix | Delete
}
[294] Fix | Delete
}
[295] Fix | Delete
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
[296] Fix | Delete
[297] Fix | Delete
unset( $this->iterations[ $nesting_level ] );
[298] Fix | Delete
unset( $this->current_priority[ $nesting_level ] );
[299] Fix | Delete
[300] Fix | Delete
$this->nesting_level--;
[301] Fix | Delete
[302] Fix | Delete
return $value;
[303] Fix | Delete
}
[304] Fix | Delete
[305] Fix | Delete
/**
[306] Fix | Delete
* Calls the callback functions that have been added to an action hook.
[307] Fix | Delete
*
[308] Fix | Delete
* @since 4.7.0
[309] Fix | Delete
*
[310] Fix | Delete
* @param array $args Parameters to pass to the callback functions.
[311] Fix | Delete
*/
[312] Fix | Delete
public function do_action( $args ) {
[313] Fix | Delete
$this->doing_action = true;
[314] Fix | Delete
$this->apply_filters( '', $args );
[315] Fix | Delete
[316] Fix | Delete
// If there are recursive calls to the current action, we haven't finished it until we get to the last one.
[317] Fix | Delete
if ( ! $this->nesting_level ) {
[318] Fix | Delete
$this->doing_action = false;
[319] Fix | Delete
}
[320] Fix | Delete
}
[321] Fix | Delete
[322] Fix | Delete
/**
[323] Fix | Delete
* Processes the functions hooked into the 'all' hook.
[324] Fix | Delete
*
[325] Fix | Delete
* @since 4.7.0
[326] Fix | Delete
*
[327] Fix | Delete
* @param array $args Arguments to pass to the hook callbacks. Passed by reference.
[328] Fix | Delete
*/
[329] Fix | Delete
public function do_all_hook( &$args ) {
[330] Fix | Delete
$nesting_level = $this->nesting_level++;
[331] Fix | Delete
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
[332] Fix | Delete
[333] Fix | Delete
do {
[334] Fix | Delete
$priority = current( $this->iterations[ $nesting_level ] );
[335] Fix | Delete
foreach ( $this->callbacks[ $priority ] as $the_ ) {
[336] Fix | Delete
call_user_func_array( $the_['function'], $args );
[337] Fix | Delete
}
[338] Fix | Delete
} while ( false !== next( $this->iterations[ $nesting_level ] ) );
[339] Fix | Delete
[340] Fix | Delete
unset( $this->iterations[ $nesting_level ] );
[341] Fix | Delete
$this->nesting_level--;
[342] Fix | Delete
}
[343] Fix | Delete
[344] Fix | Delete
/**
[345] Fix | Delete
* Return the current priority level of the currently running iteration of the hook.
[346] Fix | Delete
*
[347] Fix | Delete
* @since 4.7.0
[348] Fix | Delete
*
[349] Fix | Delete
* @return int|false If the hook is running, return the current priority level. If it isn't running, return false.
[350] Fix | Delete
*/
[351] Fix | Delete
public function current_priority() {
[352] Fix | Delete
if ( false === current( $this->iterations ) ) {
[353] Fix | Delete
return false;
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
return current( current( $this->iterations ) );
[357] Fix | Delete
}
[358] Fix | Delete
[359] Fix | Delete
/**
[360] Fix | Delete
* Normalizes filters set up before WordPress has initialized to WP_Hook objects.
[361] Fix | Delete
*
[362] Fix | Delete
* The `$filters` parameter should be an array keyed by hook name, with values
[363] Fix | Delete
* containing either:
[364] Fix | Delete
*
[365] Fix | Delete
* - A `WP_Hook` instance
[366] Fix | Delete
* - An array of callbacks keyed by their priorities
[367] Fix | Delete
*
[368] Fix | Delete
* Examples:
[369] Fix | Delete
*
[370] Fix | Delete
* $filters = array(
[371] Fix | Delete
* 'wp_fatal_error_handler_enabled' => array(
[372] Fix | Delete
* 10 => array(
[373] Fix | Delete
* array(
[374] Fix | Delete
* 'accepted_args' => 0,
[375] Fix | Delete
* 'function' => function() {
[376] Fix | Delete
* return false;
[377] Fix | Delete
* },
[378] Fix | Delete
* ),
[379] Fix | Delete
* ),
[380] Fix | Delete
* ),
[381] Fix | Delete
* );
[382] Fix | Delete
*
[383] Fix | Delete
* @since 4.7.0
[384] Fix | Delete
*
[385] Fix | Delete
* @param array $filters Filters to normalize. See documentation above for details.
[386] Fix | Delete
* @return WP_Hook[] Array of normalized filters.
[387] Fix | Delete
*/
[388] Fix | Delete
public static function build_preinitialized_hooks( $filters ) {
[389] Fix | Delete
/** @var WP_Hook[] $normalized */
[390] Fix | Delete
$normalized = array();
[391] Fix | Delete
[392] Fix | Delete
foreach ( $filters as $tag => $callback_groups ) {
[393] Fix | Delete
if ( is_object( $callback_groups ) && $callback_groups instanceof WP_Hook ) {
[394] Fix | Delete
$normalized[ $tag ] = $callback_groups;
[395] Fix | Delete
continue;
[396] Fix | Delete
}
[397] Fix | Delete
$hook = new WP_Hook();
[398] Fix | Delete
[399] Fix | Delete
// Loop through callback groups.
[400] Fix | Delete
foreach ( $callback_groups as $priority => $callbacks ) {
[401] Fix | Delete
[402] Fix | Delete
// Loop through callbacks.
[403] Fix | Delete
foreach ( $callbacks as $cb ) {
[404] Fix | Delete
$hook->add_filter( $tag, $cb['function'], $priority, $cb['accepted_args'] );
[405] Fix | Delete
}
[406] Fix | Delete
}
[407] Fix | Delete
$normalized[ $tag ] = $hook;
[408] Fix | Delete
}
[409] Fix | Delete
return $normalized;
[410] Fix | Delete
}
[411] Fix | Delete
[412] Fix | Delete
/**
[413] Fix | Delete
* Determines whether an offset value exists.
[414] Fix | Delete
*
[415] Fix | Delete
* @since 4.7.0
[416] Fix | Delete
*
[417] Fix | Delete
* @link https://www.php.net/manual/en/arrayaccess.offsetexists.php
[418] Fix | Delete
*
[419] Fix | Delete
* @param mixed $offset An offset to check for.
[420] Fix | Delete
* @return bool True if the offset exists, false otherwise.
[421] Fix | Delete
*/
[422] Fix | Delete
public function offsetExists( $offset ) {
[423] Fix | Delete
return isset( $this->callbacks[ $offset ] );
[424] Fix | Delete
}
[425] Fix | Delete
[426] Fix | Delete
/**
[427] Fix | Delete
* Retrieves a value at a specified offset.
[428] Fix | Delete
*
[429] Fix | Delete
* @since 4.7.0
[430] Fix | Delete
*
[431] Fix | Delete
* @link https://www.php.net/manual/en/arrayaccess.offsetget.php
[432] Fix | Delete
*
[433] Fix | Delete
* @param mixed $offset The offset to retrieve.
[434] Fix | Delete
* @return mixed If set, the value at the specified offset, null otherwise.
[435] Fix | Delete
*/
[436] Fix | Delete
public function offsetGet( $offset ) {
[437] Fix | Delete
return isset( $this->callbacks[ $offset ] ) ? $this->callbacks[ $offset ] : null;
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
/**
[441] Fix | Delete
* Sets a value at a specified offset.
[442] Fix | Delete
*
[443] Fix | Delete
* @since 4.7.0
[444] Fix | Delete
*
[445] Fix | Delete
* @link https://www.php.net/manual/en/arrayaccess.offsetset.php
[446] Fix | Delete
*
[447] Fix | Delete
* @param mixed $offset The offset to assign the value to.
[448] Fix | Delete
* @param mixed $value The value to set.
[449] Fix | Delete
*/
[450] Fix | Delete
public function offsetSet( $offset, $value ) {
[451] Fix | Delete
if ( is_null( $offset ) ) {
[452] Fix | Delete
$this->callbacks[] = $value;
[453] Fix | Delete
} else {
[454] Fix | Delete
$this->callbacks[ $offset ] = $value;
[455] Fix | Delete
}
[456] Fix | Delete
}
[457] Fix | Delete
[458] Fix | Delete
/**
[459] Fix | Delete
* Unsets a specified offset.
[460] Fix | Delete
*
[461] Fix | Delete
* @since 4.7.0
[462] Fix | Delete
*
[463] Fix | Delete
* @link https://www.php.net/manual/en/arrayaccess.offsetunset.php
[464] Fix | Delete
*
[465] Fix | Delete
* @param mixed $offset The offset to unset.
[466] Fix | Delete
*/
[467] Fix | Delete
public function offsetUnset( $offset ) {
[468] Fix | Delete
unset( $this->callbacks[ $offset ] );
[469] Fix | Delete
}
[470] Fix | Delete
[471] Fix | Delete
/**
[472] Fix | Delete
* Returns the current element.
[473] Fix | Delete
*
[474] Fix | Delete
* @since 4.7.0
[475] Fix | Delete
*
[476] Fix | Delete
* @link https://www.php.net/manual/en/iterator.current.php
[477] Fix | Delete
*
[478] Fix | Delete
* @return array Of callbacks at current priority.
[479] Fix | Delete
*/
[480] Fix | Delete
public function current() {
[481] Fix | Delete
return current( $this->callbacks );
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
/**
[485] Fix | Delete
* Moves forward to the next element.
[486] Fix | Delete
*
[487] Fix | Delete
* @since 4.7.0
[488] Fix | Delete
*
[489] Fix | Delete
* @link https://www.php.net/manual/en/iterator.next.php
[490] Fix | Delete
*
[491] Fix | Delete
* @return array Of callbacks at next priority.
[492] Fix | Delete
*/
[493] Fix | Delete
public function next() {
[494] Fix | Delete
return next( $this->callbacks );
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
/**
[498] Fix | Delete
* Returns the key of the current element.
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function