-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
List of all available JavaScript wp.hooks? #7712
Comments
This is still a thing. Hooks are the most primary concept in Wordpress and I can't find anywhere which hooks are available so I can extend/modify Gutenberg. Inside documentation, there are some hooks spread through methods. But I would need to read all docs to understand my possibilities (and it's possible that some of them are missing). |
hooks are not considered a primary concept in terms of JavaScript extensibility. The consensus in the core javascript chats after month exploring them is that we should avoid using/adding hooks in JavaScript and favor more targetted extensibility APIs. |
I see, I see– the situation is quite difficult in that case; you want to go into another direction, which takes time, but we, the developers, need to work with gutenberg today. Clients don't understand / accept that things take longer now, because Gutenberg is still rough and very hard to work with, when you want to dig deep. In fact, you don't even have to dig that deep.. some things that used to be quite easy "back in the day", are hard now and often require workarounds. |
Let's go into the specifics instead. If you have a particular need for an extensibility APIs that's not available, open an issue so we can discuss it. |
Thank you guys for being patient. :) I may be thinking with old Wordpress way of doing things. And I'll try to get better on this. Well, there are many things that I need to address:
Unfortunately I'm really in trouble on how to accomplish these things. hahah But I'll keep trying :) |
Aside, the first one, these things sound like good separate issues. I don't think we should expect to be able to change anything that's on the page though, so some of these items might be "rejected" but at least this could be discussed properly. Also, it's always good to explain the "why" behind these use-cases. Why do you want to change "publish" labels, why do you want to remove the "trash" button... this helps clarify the use-cases and shape the APIs. |
As you can see above I've created an issue explaining the use-case and asking more information on how to accomplish these things. |
The easiest way to get the list of available wp.hooks actions and filters :
Thats it. Since wp.hooks is not bound to Gutenberg you can use the procedere even on the wordpress dashboard or wherever |
There's also https://developer.wordpress.org/block-editor/reference-guides/filters/. Anything specific missing should be added there as new issues. |
I want to alter the "Status & Visibility" area for normal posts and disable/hide the "stick to front page" checkbox.
a post in #6533 suggests to use
withFilter
to alter / remove existing UI elements in Gutenberg.But I can't find what hook would filter this ui part, or if there even is a hook for that.
Is there a list with all available hooks?
wp.hooks
in Chromes console also didn't reveal the hooks to me :'(The text was updated successfully, but these errors were encountered: