-
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
block_enqueue_script action does not exist #1184
Comments
It's awesome that you're trying to build a blocks plugin 👍. Your feedback will be very useful. For now, I think using Also, note that the Blocks API is not frozen yet and is subject to change. |
@youknowriad thanks for your feedback. I tried to add the hook into the |
I'm wondering if we need a separate action, or if it's sufficient to merely hook Edit: Ah, I guess this would need to be limited to the editor screens, in which case having a standalone action may be a helpful convenience. |
I think the need for this would be eliminated by #1217 and being able to define assets when you call |
Just generally the entire It refers to Also including
|
Also, it's probably better to change it to be enqueued in the footer as if it's in the header I've hit a race condition where registerBlockType isn't defined yet. Maybe I should just sort this out and then submit a PR for fixing the docs. Will give it a go, but don't let me (supposedly) working on this prevent anyone else from taking up the mantle. |
I ended up here with the same question. Where are we at with the custom block at the moment. Since points raised by @georgestephanis are in-fact roadblocks for any extension whatsoever! |
Here's what I'm working off of, @ahmadawais -- https://github.com/georgestephanis/gutenberg-tweaks/ -- I'm just trying to sort out how to get anything working third-party. If you'd like to collaborate on getting something functional, I'd be delighted to add you and we can collab on Slack. |
@georgestephanis Sure thing, bit away for the moment, but that's exactly what I have had been looking into. It's |
@georgestephanis I have created a sample GitHub repo for experimental 3rd party blocks https://github.com/ahmadawais/Gutenberg-Blocks |
The hooks have been implemented in #1717. |
Also #1794 for updated docs. |
I tried to follow the README for building a block in a separate plugin but it seems the
block_enqueue_scripts
action hook does not exists and the js file responsible for the block is not being loaded.Would be a good idea to load it using a
admin_enqueue_script
until this hook will be added ?The text was updated successfully, but these errors were encountered: