Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

Gutenberg 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/

0
votes
1answer
10 views

Custom Gutenberg block is not showing up in inserter dialog

I am trying to build the simplest of custom Gutenberg block by referring the handbook https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/. The directory structure is as ...
4
votes
1answer
70 views

Extend core block in Gutenberg

for a project I have to extend the core block core/cover-image. For the first basic try I came up with the following code: PHP: add_action('enqueue_block_editor_assets', function() { ...
-3
votes
0answers
25 views

Gutenberg showing blank page on local site [on hold]

I have just set-up a LOCAL SITE out of my live site on the web. I find that everything's working fine. Except editing the posts in Gutenberg. [Classic works fine]... I used git-ftp to pull ftp server ...
4
votes
1answer
78 views

In Gutenberg, now that withAPIData is being deprecated, how can I do an async call to a custom endpoint?

I have this working in my plugin and all is well with the world: edit: withAPIData( props => { return { roles: '/matt-watson/secure-blocks/v1/user-roles/' };...
0
votes
2answers
22 views

Wordpress Editor completely blank [closed]

Although the classic editor works, I am unable to use Gutenberg. When I disable plugins in wp-content (by changing plugins to pluginsOLD), I can edit everything just fine. How can I restore the new ...
1
vote
2answers
39 views

How to check whether Gutenberg editor is installed or not

i want to ask a simple question that what to do if i have to check whether a pliugin is installed. for example i want to run a code, which says, if Gutenberg is installed, then run the following code ...
0
votes
1answer
31 views

Gutenberg Block empty after reload of editor

Well, everythings fine with this. editor and frontend works. but when i come back to pages edit screen, the block is empty. i think there is an error with the attributes, but i can't find good ...
1
vote
0answers
27 views

Gutenberg Editor - Template Doesn't Match Error

I have updated the current page template so that it is locked and uses two of custom blocks that i have created. function.php function my_add_template_to_posts() { $post_type_object = ...
0
votes
1answer
30 views

Use page Title in Gutenberg custom banner block

I have created a custom banner image block for Gutenberg, which works great, but I want to know if it is possible to use the page title as the current banner text placeholder until it has been edited?...
2
votes
1answer
29 views

Help Unregistering a Core Block Type in Gutenberg

I'm trying to unregister core block types in WordPress Gutenberg. I've used the code provided here: https://github.com/WordPress/gutenberg/blob/master/docs/extensibility/extending-blocks.md#removing-...
2
votes
2answers
32 views

Check what Gutenberg blocks are in post_content

I'm working on a design that has different styling if a certain Gutenberg block is present on a page. In other words, if the first block is a custom built Gutenberg block, the post_title is rendered ...
6
votes
1answer
108 views

check if Gutenberg is currently in use

How can I check if the editor that is currently being used is Gutenberg in a WordPress plugin? I need this because Gutenberg lacks post_submitbox_misc_actions, so I need a fallback which will only be ...
2
votes
1answer
52 views

Gutenberg add a custom metabox to default blocks

Is it possible to add custom meta boxes to the default blocks in Gutenberg? I would need to add a user-defined data-attribute to each block. This data-attribute then would be printed on the frontend ...
0
votes
1answer
31 views

Preventing double loading JS scripts (like React) when developing for Gutenberg

Gutenberg is mostly made in JS, so I'm using create-guten-block to create some custom blocks. If multiple plugins use this to create blocks, is it a problem that these scripts get compiled and loaded ...
0
votes
0answers
22 views

Spans in gutenberg

How can I make a user automatically add spans in the Gutenberg editor? I want to create a "feedback" block - an example from the link: http://bogdans-ultra-awesome-project-10773e.webflow.io But the ...
0
votes
0answers
36 views

iFrame onLoad in custom Gutenberg block

I have this code that I am trying to rewrite for Gutenberg block: <script type="text/javascript"> <iframe onload="javascript:resizeIframe(this);" src="/...
0
votes
0answers
11 views

Global InspectorElement not saving value when published

I'm trying to create a global InspectorElement fields that are going to be available for all blocks. Here's what I came up with. The problem is that when I publish the post, the field values weren't ...
5
votes
1answer
218 views

Add custom class to core blocks in Gutenberg

I'm trying to add a class to list blocks (core/list) in Gutenberg. Unfortunately, it looks like because some blocks like lists and paragraphs don't have the standard default class name of wp-block-{...
3
votes
1answer
56 views

Integrating inline tinymce editor in a component for a gutenberg block

I'm new to stack exchange. I hope my question is not to long. I want to integrate an inline tinymce editor in a component and use it in a gutenberg block. But my editors ui conflicts with gutenberg. (...
2
votes
0answers
77 views

Gutenberg block “This block appears to have been modified externally” on save

Just starting to play with Gutenberg block development, and I am building a very simple button (yes I know buttons are already included, but this block will have lots of settings and classes not ...
0
votes
0answers
32 views

Gutenberg: move block plugin between Wordpress sites?

I created a Gutenberg block plugin on one computer in a local site using create-guten-block. It works fine. I'm trying to copy/move it to a different Wordpress install on another computer, and no ...
1
vote
0answers
22 views

Gutenberg: Dynamic rendering of RichText

When I save <RichText />s content into my attributes and want to use this with render_callback in php, it get's kinda messy. As soon as the text contains RichText (bold, italic, line-breaks etc.)...
2
votes
0answers
27 views

Gutenberg: How to mix dynamic and static output?

Gutenbergs handbook (https://wordpress.org/gutenberg/handbook/blocks/creating-dynamic-blocks/) suggests to return null in the save() function for dynamic blocks. But what if I only want parts of my ...
4
votes
1answer
66 views

Gutenberg - remove / add blocks with custom script

I’m currently testing the new Gutenberg plugin with my own developed theme and plugin. My theme has a custom meta box with an action for the user. Once the user click this action the post content is ...
2
votes
1answer
126 views

Implement Panel Color Inspector Control in Gutenberg

I am trying to implement Panel Color in the Inspector Control for a custom block but can't seem to figure it out. Below is the JSX code that attempts it. It renders the block, but when it's in focus, ...
2
votes
0answers
32 views

Change order/position of Gutenberg inspector control panel

I'm adding a new panel to the Gutenberg inspector <InspectorControls> <PanelBody title={ __( 'New Settings' ) } initialOpen={ false } > ... </PanelBody> </...
3
votes
1answer
112 views

Gutenberg extend blocks add new class name

I'm trying to add an extra class name to all the blocks by extending them. Documentation: Extending Blocks I'm using blocks.BlockEdit to modify the edit component. I want to add a custom class name. ...
3
votes
1answer
76 views

Only show focused toolbar for Gutenberg Block with Multiple text fields

I'm trying to create a block with multiple text fields. That's easy enough, but when I select the block to edit it, both of the toolbars show. I've searched the documentation and can't find anything. ...
7
votes
1answer
150 views

Add To Gutenberg Sidebar

I'm trying to make sense of how to add custom page options to the right side of the Gutenberg interface. I don't think need a content block, I just need to be able to add a page-specific configuration,...
1
vote
2answers
62 views

How to access “default” property of attribute in Gutenberg

In a Gutenberg block I try to read the value of an attribute's default property, so that I can find out in the transformation routine (to another block type) if any give attribute still has the ...
5
votes
1answer
210 views

How to edit a post meta data in a Gutenberg Block?

I am trying to follow the instruction in the Gutenberg Handbook to create a block that can change meta data of a post. Though when I try to use the setAttributes function from props to save the new ...
3
votes
0answers
58 views

Running Gutenberg React in Development Mode

Is there a way to enable WordPress to run the non-minified version of React while developing Gutenberg blocks? I am receiving an error from React while learning to create Gutenberg blocks. react-dom....
1
vote
0answers
42 views

Checks when fetching data from multiple REST API endpoints in Gutenberg

I'm developing a plugin for the new Gutenberg editor and I need to retrieve data from two REST API endpoints: registerBlockType( 'my/block', { title: __( 'My Block' ), icon: 'email', ...
3
votes
0answers
112 views

Replacing Gutenberg Featured Image control?

I can replace the Featured Image control in current WP version by PHP: add_filter( 'admin_post_thumbnail_html', 'my_admin_post_thumbnail_html', 10, 2 ); How do I do the same thing with Gutenberg?
1
vote
1answer
56 views

var is undefined in a Gutenberg block

I'm fiddling with Gutenberg right now and I'm stuck trying to build a dynamic block. This is the code I'm using (some code is omitted for clarity): registerBlockType( 'my/block', { title: __( 'My ...
1
vote
2answers
94 views

lodash dependency in a Gutenberg plugin

I'm taking my first steps in Gutenberg block development and I'm already stuck. My block JS script makes use of a couple lodash functions (filter and pick). I'm registering my block using the ...
0
votes
0answers
23 views

Gutenberg: Clone “Custom HTML” block to have predefined content

There exists "Custom HTML" block. How can I create (in a plugin) "Custom HTML (updated)" block that would still insert the regular "Custom HTML" block but with pre-defined content?
0
votes
0answers
39 views

Gutenberg: @element queries

Gutenberg is about to be added in WordPress 5.0 (April 2018 or later). I started preparing "blocks" for it and one problem I see is that the same "block" can now be inserted on e.g.: A page template ...
5
votes
1answer
314 views

Gutenberg how to make attribute to save to meta

I am playing with Gutenberg and I am a bit confused about how it should save to meta. Here is my custom post and meta: add_action( 'init', function() { register_post_type( 'game', [ '...
3
votes
2answers
229 views

Wait for Gutenberg or built something in ACF?

I have a client who has requested something, that's straight out of the box, if I was using ACF. However... Gutenberg should be here any minute now and revolutionize who the editor works. I've looked ...
1
vote
1answer
268 views

fetching via fetch/ajax gutenberg block data from third party

I'm trying to use fetch to grab information from a 3rd party API which is rate-limited. Instead of doing the API on the front-end I'm trying to use fetch to do the API call in the edit function. I've ...
3
votes
1answer
140 views

Override image maximum width in theme (Using Gutenberg editor)

I recently installed Gutenberg plugin to my Wordpress installation. The theme I am using is not full width for posts. There's a "Wide" option for images in a post but the theme won't allow the image ...
3
votes
2answers
711 views

Gutenberg Inspector Controls

I am trying to make a simple Gutenberg block which implements <InspectorControls>, but I'm getting a React error no matter which I component I use. const { __ } = wp.i18n; const { ...
8
votes
1answer
601 views

How to extend the gallery block in Gutenberg?

I'm playing with Gutenberg ahead of its inclusion in core, and I'd like to know how to extend the existing gallery block to change its display. For example, instead of a grid of thumbnails I'd like to ...
2
votes
1answer
39 views

Testing custom themes / plugins under Gutenberg

I have several custom Themes and Plugins that I have written that I would like to start testing under the forthcoming WordPress 5.0 / Gutenberg version. How would I go about doing this? Just install ...
3
votes
1answer
63 views

Managing two editable fields in gutenberg

I'm building a gutenberg block plugin which takes two fields, a DOI name and a title. I can manage one successfully, but I'm not sure how to edit/save two at the same time. So far I have: ( function( ...