Dealing with unknown option ‘–variant’ when setting up a block environment

From the docs https://developer.wordpress.org/block-editor/reference-guides/packages/packages-create-block/ I would say you have to provide template also for that option, though I never used it. I recommend you to get yourself more familiar with block development, it is very clear if block is dynamic or static, if it has php callback for rendering instead of save procedure in javascript, … Read more

getBlockVariations(…) is undefined in Widget and Template Part editors but not Post Editor

Here’s why did you get an undefined The function itself was defined, but the function call (wp.blocks.getBlockVariations( ‘core/embed’ )) returned an undefined because by the time that you called the function, the block/Gutenberg editor had not yet been initialized. Hence, undefined was returned instead of an array of block variations, because core block types like … Read more

Is there any filter or action hook to remove layout classes from appearing in my templates?

You may use the following code (either in your active theme’s functions.php file or in a custom plugin): // This line is preferably be added to your theme’s functions.php file // with other add_theme_support() function calls. add_theme_support( ‘disable-layout-styles’ ); // These two lines will probably not be necessary eventually remove_filter( ‘render_block’, ‘wp_render_layout_support_flag’, 10, 2 ); … Read more

With full-site-editing menus, how do I create a non-linking top-level menu item with linking sub-pages

The new FSE editor uses a new filter, if you want to hook into that you can do it in two ways: By hooking the individual block rendering: add_filter( ‘render_block_core/navigation-link’, ‘test_render_navigation_link’, 10, 3); function test_render_navigation_link($block_content, $block) { $attributes = $block[“attrs”]; // string replace the href if you want, by checking the content of $attributes return … Read more