-
Hi, I have created my own Block Editor instance with this documentation (https://developer.wordpress.org/block-editor/how-to-guides/platform/custom-block-editor/tutorial/). I have activated all core blocks via the registerCoreBlocks function (https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-library/#registercoreblocks). Unfortunately, no external server-side blocks that use the register_block_type method works (php). If I query the list of registered blocks, they are not included (getBlockTypes) because render_callback and editor_script are not executed correctly in the front end. If I manually enqueue the handle of the script, everything works. Tried already this: https://github.com/WordPress/wordpress-develop/blob/437ac63d7652b08095dc7f77b6ba4ef52db44dbb/src/wp-admin/edit-form-blocks.php#L111-L115 Do i have to call another function in the editor? Change some editor-settings? or register/include a specific script? Question: What do I need to enable server-side blocks? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I found the solution by myself. You have to register and set a screen and then change the options from the screen: is_block_editor to true. Then the Scripts and Styles should be enqueded in the editor. See: https://developer.wordpress.org/reference/hooks/should_load_block_editor_scripts_and_styles/ and the script-loader.php file from wp core. |
Beta Was this translation helpful? Give feedback.
I found the solution by myself. You have to register and set a screen and then change the options from the screen: is_block_editor to true. Then the Scripts and Styles should be enqueded in the editor. See: https://developer.wordpress.org/reference/hooks/should_load_block_editor_scripts_and_styles/ and the script-loader.php file from wp core.