WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.52k stars 4.21k forks source link

[Feature request] A list of available JS action hooks in front-end "wp.hooks.actions" object #65094

Open ChrisPlaneta opened 2 months ago

ChrisPlaneta commented 2 months ago

What problem does this address?

I am unable to learn what JS actions I can hook to at a given page. The documentation does not help in this matter and since there is no longer an exact-match search in Google search, then searching for "wp.hooks.actions" gives very inacurate results..

I only found several hooks going through wordpress code on github. It took me a lot of time and few results is not good enough. I need to know what hooks I can use to make more responsive solutions that react to what is happening on the page.

What is your proposed solution?

For starters, a list of available hooks in wp.hooks.available - just a simple array. Later, we could really use better documentation about these hooks.

gziolo commented 1 month ago

I am unable to learn what JS actions I can hook to at a given page.

What is the exact screen that you would like to customize with JavaScript implementation of WordPress hooks? There are some in the editor screens in WP Admin. Some are documented in: https://developer.wordpress.org/block-editor/reference-guides/#hooks-reference