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

A way to get all defined blocks from the rest-API / php #3024

Closed
janw-me opened this issue Oct 16, 2017 · 1 comment
Closed

A way to get all defined blocks from the rest-API / php #3024

janw-me opened this issue Oct 16, 2017 · 1 comment

Comments

@janw-me
Copy link
Contributor

janw-me commented Oct 16, 2017

Currently most core blocks are defined in gutenberg/blocks/build/index.js and gutenberg/editor/build/index.js (PS I'm using the plugin from dotorg)

I want to set up some conditionals depending on what blocks are in a post. And I want a user to select which blocks are allowed. But for that I need to fill a select with the blocks.

It's doable to fill the select with JS if you wp_enqueue_script( 'wp-blocks' ); on the pages you need, but then you are loading most of gutenburg on that page just to get the blocks.
I've red the way to add new blocks

Shouldn't there be an other way to do this?
Putting this in the rest API seems like a nice way to do this.

@aduth
Copy link
Member

aduth commented Oct 16, 2017

Yes, it's been proposed that all blocks should have some amount of a server definition. Considering this as a duplicate of #2751, but the reference will prove valuable as a concrete use-case. Thanks!

@aduth aduth closed this as completed Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants