- Timestamp:
- 06/03/2024 07:45:57 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-open-elements.php
r57264 r58304 53 53 54 54 /** 55 * A function that will be called when an item is popped off the stack of open elements. 56 * 57 * The function will be called with the popped item as its argument. 58 * 59 * @since 6.6.0 60 * 61 * @var Closure 62 */ 63 private $pop_handler = null; 64 65 /** 66 * A function that will be called when an item is pushed onto the stack of open elements. 67 * 68 * The function will be called with the pushed item as its argument. 69 * 70 * @since 6.6.0 71 * 72 * @var Closure 73 */ 74 private $push_handler = null; 75 76 /** 77 * Sets a pop handler that will be called when an item is popped off the stack of 78 * open elements. 79 * 80 * The function will be called with the pushed item as its argument. 81 * 82 * @since 6.6.0 83 * 84 * @param Closure $handler The handler function. 85 */ 86 public function set_pop_handler( Closure $handler ) { 87 $this->pop_handler = $handler; 88 } 89 90 /** 91 * Sets a push handler that will be called when an item is pushed onto the stack of 92 * open elements. 93 * 94 * The function will be called with the pushed item as its argument. 95 * 96 * @since 6.6.0 97 * 98 * @param Closure $handler The handler function. 99 */ 100 public function set_push_handler( Closure $handler ) { 101 $this->push_handler = $handler; 102 } 103 104 /** 55 105 * Reports if a specific node is in the stack of open elements. 56 106 * … … 430 480 break; 431 481 } 482 483 if ( null !== $this->push_handler ) { 484 ( $this->push_handler )( $item ); 485 } 432 486 } 433 487 … … 459 513 break; 460 514 } 515 516 if ( null !== $this->pop_handler ) { 517 ( $this->pop_handler )( $item ); 518 } 461 519 } 462 520 }
Note: See TracChangeset
for help on using the changeset viewer.