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
28
votes
3answers
25k 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 ...
15
votes
8answers
9k 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 ...
8
votes
2answers
4k 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
256 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
412 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
595 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="/...
13
votes
2answers
18k views

How to add a custom CSS class to core blocks in Gutenberg editor?

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
2k 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
2answers
1k 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 ...
1
vote
1answer
501 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
475 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 ...
10
votes
1answer
4k 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 ...
4
votes
3answers
5k 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, ...
5
votes
1answer
892 views

Change order/position of Gutenberg inspector control panel

I'm adding a new panel to a Gutenberg block through the editor.BlockEdit wp.block filter. <InspectorControls> <PanelBody title={ __( 'New Settings' ) } initialOpen={ false } > ... ...
3
votes
1answer
5k 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
1k 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. ...
9
votes
1answer
6k 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,...
3
votes
2answers
4k 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 ...
8
votes
1answer
3k 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 ...
12
votes
1answer
2k 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
147 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', ...
6
votes
1answer
871 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
547 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 ...
3
votes
2answers
4k 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 ...
4
votes
3answers
4k 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', [ '...
4
votes
2answers
448 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 ...
2
votes
1answer
5k 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
562 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 ...
4
votes
3answers
6k 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 { ...
16
votes
2answers
14k 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
63 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 ...
4
votes
1answer
1k 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( ...

1
23 24 25 26
27