Using wp_set_script_translations without manually registering the script

@drskullster already posted a good answer, but I thought I should share the following which explains why wp_set_script_translations() needs to be called manually: Yes it’s true that WordPress will automatically register and enqueue the block editor script. So we do not need to manually register/enqueue that script! WordPress will also automatically set the script’s translations, … Read more

Gutenberg programmatically move block to position

You can use getBlockRootClientId() from the block editor’s data store. E.g. wp.data.select( ‘core/block-editor’ ).getBlockRootClientId( clientId ) And here’s a working example for you to see how it can be used in an edit() function, where my block contains a demo button which will move the block to the very last or first position: WordPress dependencies: … Read more