Looking for all available options of Gutenberg Block

Option 1 Browse the block-library package in the Gutenberg’s GitHub repository, and find the block metadata in a JSON file named block.json of the specific block. For example, for the core/image block, you can find the metadata (e.g. all available/supported attributes) here: https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/image/block.json So basically, the URL format is: https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/{name}/block.json where {name} is the block … Read more

How do I get the current post ID within a Gutenberg/Block Editor block?

To simply get the value you can call the selector: const post_id = wp.data.select(“core/editor”).getCurrentPostId(); In this case, the post id won’t change, so you could assign the value to a constant outside of the component: const { Component } = wp.element; const { getCurrentPostId } = wp.data.select(“core/editor”); const post_id = getCurrentPostId(); // class component class … Read more

Disable Gutenberg text-Settings in all blocks

The closest I can find in the documentation is disabling custom font size (the text input) and forcing the dropdown font size to only contain “Normal”. add_action(‘after_setup_theme’, ‘wpse_remove_custom_colors’); function wpse_remove_custom_colors() { // removes the text box where users can enter custom pixel sizes add_theme_support(‘disable-custom-font-sizes’); // forces the dropdown for font sizes to only contain “normal” … Read more

Remove block styles in the Block Editor

We start off by finding out which block styles exists via .getBlockTypes(). This will dump it into the console: wp.domReady(() => { // find blocks styles wp.blocks.getBlockTypes().forEach((block) => { if (_.isArray(block[‘styles’])) { console.log(block.name, _.pluck(block[‘styles’], ‘name’)); } }); }); Example output: core/image (2) [“default”, “rounded”] core/quote (2) [“default”, “large”] core/button (2) [“fill”, “outline”] core/pullquote (2) [“default”, … Read more

Help Unregistering a Core Block Type in Gutenberg

Everything works for me with allowed_block_types hook. Example: add_filter( ‘allowed_block_types’, ‘my_function’ ); function my_function( $allowed_block_types ) { return array( ‘core/paragraph’ ); } You can insert the above code to your functions.php file to a custom plugin. It removes all blocks except the Paragraph block. More examples here https://rudrastyh.com/gutenberg/remove-default-blocks.html

Integrate Gutenberg as a Standalone App

Yes, You can use Gutenberg as a standalone app or CMS agnostic app. Drupal using Gutenberg as a npm module and then integrating in their own CMS. Drupal Gutenberg is decoupling Gutenberg from WordPress and using as JS editor Gutenberg JS. This way, developers can build block for Gutenberg and port it to two different … Read more

How to detect the usage of Gutenberg

There are several variants: WordPress 4.9, Gutenberg plugin is not active WordPress 4.9, Gutenberg plugin is active WordPress 5.0, Block Editor by default WordPress 5.0, Classic Editor plugin is active WordPress 5.0, Classic Editor plugin is active, but in site console in “Settings > Writing” the option “Use the Block editor by default…” is selected … Read more

Add To Gutenberg Sidebar

If you’re looking to work with the Gutenberg sidebar, WordPress has a provided tutorial that will teach you exactly how to do this: https://wordpress.org/gutenberg/handbook/designers-developers/developers/tutorials/plugin-sidebar-0/

How does Gutenberg handle translations in React?

In the Gutenberg’s GitHub repository you can see the source of the i18n package that is used. In this source, you’ll see Jed getting imported (line 4 of gutenberg/packages/i18n/src/index.js) and then being used for most of the translation tasks under the hood. Jed introduces the “Gettext Style i18n for Modern JavaScript Apps” (or at least … Read more

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