Changeset 56609 for trunk/src/wp-includes/class-wp-hook.php
- Timestamp:
- 09/18/2023 12:39:18 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-hook.php
r56549 r56609 28 28 29 29 /** 30 * Priorities list. 31 * 32 * @since 6.4.0 33 * @var array 34 */ 35 protected $priorities = array(); 36 37 /** 30 38 * The priority keys of actively running iterations of a hook. 31 39 * … … 87 95 } 88 96 97 $this->priorities = array_keys( $this->callbacks ); 98 89 99 if ( $this->nesting_level > 0 ) { 90 100 $this->resort_active_iterations( $priority, $priority_existed ); … … 103 113 */ 104 114 private function resort_active_iterations( $new_priority = false, $priority_existed = false ) { 105 $new_priorities = array_keys( $this->callbacks );115 $new_priorities = $this->priorities; 106 116 107 117 // If there are no remaining hooks, clear out all running iterations. … … 187 197 if ( ! $this->callbacks[ $priority ] ) { 188 198 unset( $this->callbacks[ $priority ] ); 199 200 $this->priorities = array_keys( $this->callbacks ); 189 201 190 202 if ( $this->nesting_level > 0 ) { … … 263 275 264 276 if ( false === $priority ) { 265 $this->callbacks = array(); 277 $this->callbacks = array(); 278 $this->priorities = array(); 266 279 } elseif ( isset( $this->callbacks[ $priority ] ) ) { 267 280 unset( $this->callbacks[ $priority ] ); 281 $this->priorities = array_keys( $this->callbacks ); 268 282 } 269 283 … … 290 304 $nesting_level = $this->nesting_level++; 291 305 292 $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );306 $this->iterations[ $nesting_level ] = $this->priorities; 293 307 294 308 $num_args = count( $args ); … … 349 363 public function do_all_hook( &$args ) { 350 364 $nesting_level = $this->nesting_level++; 351 $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );365 $this->iterations[ $nesting_level ] = $this->priorities; 352 366 353 367 do { … … 482 496 $this->callbacks[ $offset ] = $value; 483 497 } 498 499 $this->priorities = array_keys( $this->callbacks ); 484 500 } 485 501 … … 496 512 public function offsetUnset( $offset ) { 497 513 unset( $this->callbacks[ $offset ] ); 514 $this->priorities = array_keys( $this->callbacks ); 498 515 } 499 516
Note: See TracChangeset
for help on using the changeset viewer.