Commit cdf86a9
committed
Hooks: Fix pointer over-advance in resort_active_iterations()
When a callback removes itself during execution and is the only entry at that priority, the internal array pointer is re-positioned by resort_active_iterations().
Before this fix, the pointer ended up at the next priority, but the subsequent next() call in the main apply_filters() loop would then advance it once more, skipping the next priority entirely.
Calling prev() ensures the pointer is balanced so the next() call lands correctly on the intended priority.
Fixes #64653.1 parent 4d3b0b9 commit cdf86a9
File tree
3 files changed
+675
-0
lines changed- src/wp-includes
- tests/phpunit/tests/hooks
3 files changed
+675
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
0 commit comments