Questions tagged [block-editor]

The Block Editor is the 'new publishing experience' slated for introduction in WordPress 5.0, replacing TinyMCE and other aspects of the default editing experience. Find out more at https://wordpress.org/gutenberg/

Filter by
Sorted by
Tagged with
0
votes
1answer
12 views

Find all the places where a block type is used

I have a plugin installed that adds additional custom block types that can be used in the Gutenberg editor (the plugin is called Block Lab). Now I want to remove that plugin. For that, I have to ...
0
votes
0answers
8 views

How to apply onMerge in a block Edit class

I'm making a custom paragraph block, but I'm having trouble allowing it to be merged with another of the same block type. I've successfully implemented the onSplit function (paired with onReplace) by ...
0
votes
0answers
9 views

How to add more default colors?

I just reinstalled my website with the same theme and now the other default colors are gone. Only black is left. Is there a way to add more default colors?
0
votes
0answers
10 views

event/callback on block update?

I am attempting to put together a custom block that produces an embed from a third party. The embed is generated by an external script scanning for an element with a data attribute holding a unique ...
0
votes
0answers
12 views

Gutenberg - Title field required

I'm trying to make the title field required in Gutenberg editor interface. The PHP functions I found work with Classic editor interface but not with Gutenberg. I tried to add required attribute on ...
0
votes
1answer
8 views

Better search on WordPress.org Plugins?

I'm trying to find some specific plugin for Accordion (FAQ), but to be in a form of Gutenberg Block. There is a group of "block enabled" plugins on https://wordpress.org/plugins/browse/blocks/ There ...
2
votes
0answers
7 views

initial open/toggle PluginDocumentSettingPanel panel in document setting block editor gutenberg

i want make new panel inside document setting tab with React Script from this documentation but the problem panel not toggle onload/initial i have try open with dispatch('core/edit-post')....
0
votes
1answer
12 views

How to update a Gutenberg block without manually recovering it?

I have built a Gutenberg block which is used on several pages on a client site. When the block is modified after a client request, it breaks the block on the editor of all the pages which needs to be ...
0
votes
1answer
9 views

Gutenberg blocks - template_lock with several post type

I use template_lock to lock some Gutenberg blocks. But I would like to use it in three differents post type. get_post_type_object(); admit only string, no array. How to use several post type without ...
0
votes
0answers
9 views

How to open popup window in block editor with custom buttons?

I am new to wordpress. I want to open a popup from a custom button in the block editor, and return a value to the text being edited. I create the button like this: https://developer.wordpress.org/...
4
votes
1answer
87 views

Show control conditionally in Gutenberg

I have this custom post type with two meta fields that I need to show as toggle controls (RestrictControl and SubscribeControl) in the PluginDocumentSettingPanel sidebar in the Gutenberg editor. The ...
0
votes
0answers
8 views

Does the ServerSideRender callback require wp_die()?

Since the php function associated with a Gutenberg block ServerSideRender is effectively called via ajax, should the function close with wp_die() like other registered ajax action callbacks?
0
votes
0answers
10 views

How do you change the thumbnail size on WP link embed in the Block Editor?

When I use the WordPress Embed block in the Block Editor, the preview image pulls the thumbnail (150px) and stretches it, rather than grabbing the featured image and sizing it down. How can I change ...
0
votes
0answers
13 views

Gutenberg TextareaControl escapes html

I built a block which has 3 TextareaControl. HTML, SCRIPT, STYLE. SCRIPT and STYLE are fine but TextareaControl escapes html. <p>test</p> becomes &lt;p>test&lt;/p> I ...
0
votes
0answers
14 views

Filter post_content before loading in Gutenberg editor

I'm trying to manipulate the editor content(blocks) before it's shown in the editor. So ideally I would perform a search and replace and the editor will have a modified version of blocks, but will not ...
0
votes
1answer
20 views

How to Add extra option to Image Block Settings?

How to add an option to Gutenberg Image block which lets me choose where the image is allowed to Pin in Pinterest or not (like Checkbox) along with Pin Description. Here are the example data to be ...
0
votes
0answers
11 views

How to increase width of code block in WordPress blog?

I am new to writing blogs on WordPress and facing when adding code snippets (Java/Scala code). Whenever I add code snippet and choose codeblock in the blog, since width of code block is too small ...
0
votes
0answers
17 views

Gutenberg Shortcode will turn html to html entity

I defined a shortcode [plot] to write dot code. For example, I insert code below by using Gutenberg Shortcode: [plot] digraph G { a->b; } [/plot] But when I re-edit the code, it will be converted ...
1
vote
0answers
27 views

JSX in WordPress Plugin Development

plugin.php <?php /** * Plugin Name: Test * Version: 1.0.0 */ defined( 'ABSPATH' ) || exit; function test__register_block() { if ( ! function_exists( 'register_block_type' ) ) { /...
1
vote
0answers
18 views

How should you internationalize javascript spread in multiple files but build in one?

I have followed the instructions for internationalization on: https://developer.wordpress.org/block-editor/developers/internationalization/, but it doesn't seem to play well with the development tools ...
0
votes
0answers
10 views

Block template: Image block with media pre-selected

I have a block template for a custom post type. It has an audio player followed by a link to a YouTube video, and I'd like to have a YouTube logo to the left of the video link. But what I can't figure ...
0
votes
1answer
16 views

Quickest way of developing custom Gutenberg Blocks

Is there an easier and faster way to develop custom blocks than developing and manually building them every time? This just seems to be a lot more complex than it should be, even with Wordpress ...
0
votes
0answers
11 views

Block editor: request for “input with button” component

Until I learn how to build my own react components for the block editor, I would like to request an input with button component for the block editor, especially for the InspectorTools area. For the ...
0
votes
0answers
17 views

Wordpress Guttenberg - How to get query attributes in a dynamic block?

I am trying to create a dynamic block and I am unable to determine the way to grab this information on the PHP side. Currently my index.js has: import edit from "./edit"; import { registerBlockType ...
0
votes
0answers
31 views

Required/Mandatory fields in WordPress Admin

Looking for a solution for WordPress Admin where fields such as Title, Excerpt, Category are required before being able to publish. Warning message or alert displaying what is missing because it is ...
0
votes
0answers
18 views

how to use a Text component in javascript?

I'm building an InspectorTools interface for a Gutenberg block. I can't figure out how to use the Text component. There aren't really any examples for use in javascript. The page https://developer....
0
votes
0answers
13 views

Gutenberg blocks for custom user role

I'm trying to hide all the default gutenberg blocks except my custom ACF blocks. The problem is, I created custom user role : student. With administrator role I got my custom block introduction but ...
0
votes
0answers
25 views

&shy; hyphenation not working in Gutenberg editor

Thanks to the German language, I happen to have some really long words in my WordPress 5.4.1 content. I need to decide where exactly to hyphenate, as the standard hyphenation is dumb. If I enter ...
1
vote
1answer
28 views

can a buttongroup have a label?

I'm developing a Gutenberg block, and am trying to create some InspectorControls. I would like to create a buttongroup to control the alignment of a specific element within the block (I would add that ...
0
votes
2answers
18 views

How to return div with custom attributes(Coding a Gutenberg Block)

I'm making a review widget that comes as a shortcode and Gutenberg block. The shortcode part was easy as I have built many shortcodes before, but I'm stuck on building my first Gutenberg block. More ...
1
vote
0answers
20 views

gutenberg block - how to force update after attribute changed?

I built a custom Gutenberg block to show ONE post of a custom post type called story. Most things are finally working fine, story shows up as wanted via ServerSideRendering. To select the story-to-...
0
votes
0answers
20 views

SVG (file) Animation Not Working on Safari

I'm working on a WordPress site that's using Block Styles. We have a few blocks that have custom style templates that users can select when they add a new block. One template has an image that is ...
1
vote
0answers
9 views

Help with using getBlockIndex

Related to this issue I'm trying to get the index of a child block within a parent, to use in the php rendering as a tab index. Attempting to add this code to the Child itself, so on save it can ...
0
votes
0answers
6 views

Is there a way to remove a block on selection of some other block?

I have 7 individual blocks (name, email... etc.) and then a (default) block containing all fields. The reason I am giving this either a user can fill out all the default fields or he can pick and ...
1
vote
1answer
14 views

How to extend custom (non-core) blocks?

I created few custom blocks which work just fine. I plan for these blocks to have common attributes and I'm using the blocks.registerBlockType filter to add an attribute, here is my code: import { ...
2
votes
0answers
7 views

How can I filter block registration based on post-type? (Block alignment settings)

I want to disable the .alignwide and .alignfull block alignment options (remove them from the editor UI) on the 'post' post-type only. I have tried using this block registration filter to modify the '...
1
vote
3answers
37 views

How to use Gutenberg blocks in widgets?

I can't believe that I can't find anything about this topic somewhere on the internet. Or maybe I just overlooked this option: How do I use Gutenberg Blocks in my widget? For example the "button" ...
0
votes
1answer
15 views

How can I add Block Style support to the core HTML block in Gutenberg?

The HTML block in Gutenberg can be given styles like so: // JS file, enqueued using the action "enqueue_block_editor_assets" wp.blocks.registerBlockStyle( 'core/html', { name: 'full-width-video', ...
0
votes
1answer
59 views

Issue migrating a checkbox-type meta field to the block editor

I'm trying to add Gutenberg support to a plugin that registers a custom post type with a checkbox-type meta field called _meta_restrict, while maintaining back-compatibility with the classic editor at ...
2
votes
1answer
17 views

Gutenberg default initial values for FocalPointPicker

I am trying use <FocalPointPicker /> in <PluginDocumentSettingPanel /> and almost everything working as it should, but I have troubles when creating a new post. I am getting this warning: ...
2
votes
0answers
26 views

How to save a ToggleControl value in a meta field?

I registered a boolean meta field called _meta_restrict in a custom post type: PHP: function register_meta_fields() { register_post_meta( 'custom_post_type', '_meta_restrict', array( '...
4
votes
0answers
28 views

Using Primary Color in Plugin Block

I'm developing a Gutenberg block, and I want the block to fit in as nicely as possible with the users site. So I'm trying to include as little styling of my own as possible, eg. allowing buttons to ...
0
votes
0answers
16 views

The editor has encountered an unexpected error. Shortcut key to duplicate Ctrl+Shift+D breaks gutenberg

whenever I try to use the shortcut key to duplicate Ctrl+Shift+D , wordpress gutenberg editor just errors out “The editor has encountered an unexpected error” Please help, its very hard to write ...
0
votes
1answer
23 views

Custom Meta Box not Saving in Posts with Gutenberg Editor

I've read quite a bit of documentation around it, tons of other answers here, but I can't seem to discern why the custom meta box I'm trying to add to posts (and pages, but let's start with one at a ...
0
votes
0answers
21 views

Add button next to Switch to Draft, Publish, Preview in Gutenberg

I'm trying to add a button to the edit-post-header__settings layer in the Gutenberg editor, the one that contains the Preview, Publish, Switch to Draft buttons. These are the buttons on the top right ...
1
vote
0answers
10 views

Is it possible to switch Gutenberg's editor styles when document settings change?

I want to show different editor styles based on one of the post's value in the core/editor store. Let's say, for example, that I've got a setting like, picture_frame in my post meta, that adds gimicky ...
0
votes
1answer
9 views

Gutenberg editor failing to load correctly after new theme install

We have installed a new theme on our site, but the editor just loads into a single code editor window (best to see the attached). The old theme did have the gutenberg editor disabled in functions.php, ...
0
votes
0answers
12 views

Is it possible to query post meta inside the `blocks.registerBlockType` filter?

I'm trying to get post meta while modifying a block with the blocks.registerBlockType filter, but I'm getting a console error. This is my code; const modifyBlock = (settings, name) => { if (name ...
0
votes
0answers
10 views

Is there a way to modify attributes of a parent element in Gutenberg?

I've seen lots of ways to modify attributes of blocks, but is there a way to modify the parent element that contains all of the blocks? Note: I am not asking about how to create nested blocks, but ...
0
votes
2answers
23 views

How To Apply Different Styles To All Blocks Based on Post Meta Value?

I'm looking for a way to pass post meta data to each of the blocks in the editor for the purpose of styling the content. My actual use case is hard to explain briefly, but for the sake of example, ...

1
2 3 4 5
16