standalone-block-editor icon indicating copy to clipboard operation
standalone-block-editor copied to clipboard

Custom blocks not showing up on the editor

Open anver opened this issue 4 years ago • 5 comments

Hi Dave,

Gr8 work, I'm using this as a starter to build a drag and drop form builder. My plan is to build a outer form wrapper and drag and drop custom components into this wrapper to build the form. The custom components I build shows up on the normal page and post editors but it doesn't show up on my custom editor, any help would be appreciated.

Thx

anver avatar Feb 28 '21 12:02 anver

Hi @anver did you found an solution? I have the same problem with server side registered blocks. Core-Blocks work perfect.

devfle avatar Apr 12 '22 16:04 devfle

Is there a solution for this problem? @getdave @devfle @anver

rezaelahidev avatar Oct 30 '22 11:10 rezaelahidev

@rezaelahidev I don't have one at the moment. Pull requests are very welcome.

You could also consider https://github.com/Automattic/isolated-block-editor/

getdave avatar Oct 31 '22 10:10 getdave

Hey @rezaelahidev @getdave,

to load custom blocks, you have to set a screen and the is_block_editor property to true. Then all 3rd Party Blocks register correctly. https://developer.wordpress.org/reference/classes/wp_screen/is_block_editor/

Github: https://github.com/WordPress/wordpress-develop/blob/6.0.2/src/wp-admin/includes/class-wp-screen.php#L196

devfle avatar Oct 31 '22 12:10 devfle

Hey @rezaelahidev @getdave,

to load custom blocks, you have to set a screen and the is_block_editor property to true. Then all 3rd Party Blocks register correctly. https://developer.wordpress.org/reference/classes/wp_screen/is_block_editor/

Github: https://github.com/WordPress/wordpress-develop/blob/6.0.2/src/wp-admin/includes/class-wp-screen.php#L196

@devfle thank you for this. Would you consider raising a PR to add this functionality by default?

getdave avatar Oct 31 '22 13:10 getdave

@devfle I see this code is already in the init.php:

$current_screen->is_block_editor( true );

But custom blocks still not registering.

rilwis avatar Nov 09 '22 02:11 rilwis

@rilwis i will look tomorrow.

devfle avatar Nov 09 '22 19:11 devfle

Created a PR that should fix this issue.

devfle avatar Nov 10 '22 17:11 devfle