Gutenberg: Block validation failed

In short, when saving an attribute, make sure its type matches the one that you defined in the block’s attributes option. The docs says: Lastly, make sure that you respect the data’s type when setting attributes, as the framework does not automatically perform type casting of meta. Incorrect typing in block attributes will result in … Read more

Allow excerpt for pages in Gutenberg?

It’s nothing new with the block editor, it’s the same age-old way by putting the following code into your theme’s functions.php: add_action( ‘init’, ‘wpse325327_add_excerpts_to_pages’ ); function wpse325327_add_excerpts_to_pages() { add_post_type_support( ‘page’, ‘excerpt’ ); } Here’s my screenshot in a fresh WordPress 5.0.3 install:

What is the advantage of ‘register_block_type’ (the PHP function) when creating custom blocks?

1.: The register_block_type lets you load additional stylesheets and scripts for your block in the frontend 2.: As you yourself wrote, register_block_type lets you define a dynamic php render_callback function 3.: If you use a render_callback, you can of course use filters within it. EDIT: As the comments pointed out, there is some clarification needed … Read more

gutenberg block – how to force update after attribute changed?

In this instance, you are treating the asynchronous jQuery AJAX call as a synchronous function, resulting in getStoriesList() consistently returning undefined as the function returns immediately after dispatching the HTTP request; trying to access response.status should be consistently throwing ReferenceError: response is not defined. In almost all cases it is more ideal to access data … Read more

Blocks: set a default value for a TextControl

Try setting the default value in your attributes instead of on the TextControl. registerBlockType( ‘cgb/a11ytable’, { title: ‘Accessible Table’, icon: ‘screenoptions’, category: ‘common’, attributes: { numCols: { type: ‘number’, default: 2 // Added default value } }, edit: (props) => { const { attributes: { numCols }, className, setAttributes } = props; return [ el( … Read more

Are there ways to make the Gutenberg editor wider? And the HTML-block higher?

You have to enqueue first the style editor css function legit_block_editor_styles() { wp_enqueue_style( ‘legit-editor-styles’, get_theme_file_uri( ‘/style-editor.css’ ), false, ‘2.3’, ‘all’ );} add_action( ‘enqueue_block_editor_assets’, ‘legit_block_editor_styles’ ); Then you have to create that style-editor.css file inside your theme and then add this inside that file: .wp-block { max-width: 100%;}

deneme bonusu veren sitelerbahis casinomakrobetceltabetpinbahispolobetpolobet girişpinbahis girişmakrobet girişpulibet girişmobilbahis girişkolaybet giriş