Set Post Title to Read-only and Disable Permalink Slug Editor in Gutenberg

I used this, inline, on specific pages (using get_current_screen()). I’d hoped this would enable me to hide/show the permalink panel under certain conditions. However, removeEditorPanel() removes the permalink panel globally. This isn’t completely horrifying, since the css still works conditionally, and the permalink can still be edited via the editor (by clicking on the title) … Read more

Gutenberg: Error loading block: Invalid parameter(s): attributes but it can be used in the code

The error in question is likely because when you run register_block_type(), you didn’t set the block attributes or that it (which is an array in PHP) doesn’t have the attribute named content. So make sure the attributes are defined in both JavaScript (via registerBlockType()) and PHP (via the above-mentioned function), and that the schema is … Read more

Show control conditionally in Gutenberg

There are 2 main issues in your code: What is that restrict in your OptionsPanel component? Where and how you defined it? Both the onUpdateRestrict and onUpdateSubscribe are not functions, so clicking on the toggle controls will result in a JavaScript error. And if you can show your complete code, I can probably help you … Read more

Setting default font family with theme.json

I had the same problem and I find out how to solve it: For each “fontFamily” inside “fontFamilies” array, you get a custom variable. From your example You can use both variables on your stylesheet or in theme.json: –wp–preset–font-family–helvetica-arial –wp–preset–font-family–ubuntu-sansserif And then you call the font like this: { “version”:1, “settings”: { “typography”: { “fontFamilies”: … Read more

Extend core block in Gutenberg

Not a real answer alert This sounds like a long term bad idea. You are modifying a core functionality with something which do not inherit any of the generated markup of the original block. Any later processing of the block might make assumption about the markup based on the block name, but the assumptions might … Read more