[wp-trac] [WordPress Trac] #17817: do_action/apply_filters/etc. recursion on same filter kills underlying call
WordPress Trac
noreply at wordpress.org
Tue Sep 6 02:46:14 UTC 2016
#17817: do_action/apply_filters/etc. recursion on same filter kills underlying call
-------------------------------------------------+-------------------------
Reporter: kernfel | Owner: pento
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.7
Component: Plugins | Version: 2.2
Severity: normal | Resolution:
Keywords: has-patch needs-testing has-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Comment (by pento):
The last few patches reminded why it's super annoying that
`apply_filters()` and `do_action()` are very-similar-but-different bits of
code.
[attachment:17817.20.diff] merges the two, so `::do_action()` now calls
`::apply_filters()`. I've added a unit test to check that multiple hooks
against an action will still get the same value passed.
This was surprisingly easy to do, which was nice, but makes me very
suspicious. Please read the code and think about ways to make it explode.
:-)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/17817#comment:203>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list