Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wp.hooks: support the special all hook #8602

Closed
adamsilverstein opened this issue Aug 6, 2018 · 4 comments · Fixed by #12038
Closed

wp.hooks: support the special all hook #8602

adamsilverstein opened this issue Aug 6, 2018 · 4 comments · Fixed by #12038
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Feature] Extensibility The ability to extend blocks or the editing experience [Package] Hooks /packages/hooks [Type] Enhancement A suggestion for improvement.

Comments

@adamsilverstein
Copy link
Member

To match feature parity with the current PHP hooks system in WordPress core, can we add support for an all action?

A callback added to the 'all' hook fires on any/every hook - especially useful for debugging.

see:
https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/plugin.php#L183-L199
https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/plugin.php#L437-L453

@krisgale-zz
Copy link

do it, for science!

@danielbachhuber danielbachhuber added [Feature] Extensibility The ability to extend blocks or the editing experience Backwards Compatibility Issues or PRs that impact backwards compatability [Package] Hooks /packages/hooks [Type] Enhancement A suggestion for improvement. labels Aug 6, 2018
@aduth
Copy link
Member

aduth commented Oct 23, 2018

If it is primarily intended for debugging, then it might be worth exploring optimizations to avoid any impact in typical usage, e.g. monkey-patching runHooks when an all hook is added.

@adamsilverstein
Copy link
Member Author

e.g. monkey-patching runHooks when an all hook is added.

great suggestion, I am also concerned about the performance impact and this might be a way to address that.

@adamsilverstein
Copy link
Member Author

WIP: #12038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backwards Compatibility Issues or PRs that impact backwards compatability [Feature] Extensibility The ability to extend blocks or the editing experience [Package] Hooks /packages/hooks [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants