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

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/

0
votes
0answers
12 views

WordPress is forcing me to update to latest version of WP - 5.0. Which is with Gutenberg

I didn't want to update my WP Core yet, but some some reason when I try to edit a page or update a plugin it forces me to update my WP core on the website to 5.0. Has anyone been in the same ...
0
votes
0answers
3 views

How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?

I want to use Categorie and Tags everywhere in WP (Articles, Pages, Attachments and CPT like for example Jetpack-Portfolio) I have been able to show these 2 core taxonomies (category and post_tag) in ...
1
vote
1answer
10 views

How do I disable wpautop for a specific block?

I've registered a custom editor block with Advanced Custom Fields (ACF), and am using render_template with a PHP template partial to display the block contents. Inside the template is some HTML (...
0
votes
0answers
23 views

How to remove p / br elements from gutenbergs editor

We updated to Wordpress 5.0 on our website, problem is that this includes the new gutenberg editor. Before this I already removed the WP function that sometimes places <p> and <br> ...
0
votes
1answer
19 views

How to remove whitespaces from source of posts created through WordPress Gutenberg editor

my understanding is that empty lines are created when Gutenberg removes the block comment. so how can i remove this?
1
vote
0answers
15 views

Adding Class to Default Wordpress Gutenberg Blocks?

I tried to search for the best way to add classes to default Gutenberg blocks and was unable to find anything. What I need to do is add a class that I can target on each default block that Gutenberg ...
0
votes
0answers
21 views

How to display full width block without toolbar?

I'm trying to create a full width blocks for the new Gutenberg editor, however I don't want to give to option to toggle the block alignment (eg: like the Cover block does) just make it full width all ...
0
votes
1answer
27 views

WP 5 how to add_editor_style for both tinyMCE and Gutenberg

Before Gutenberg blocks we used to add editor styles by using add_editor_style( array( 'path/to/editor-style.css', 'whatever.css' ) ); Now we have Gutenberg editor whose stylesheet is also loaded by ...
1
vote
0answers
21 views

How to add button to post page WordPress 5.x

How can I add a button to a posts page? what hook can be used to add a custom button I'd like to place it next to, or near, the "Publish/update" button, or modify the publish button for triggering ...
1
vote
0answers
23 views

Gutenberg not all editor text translated

I just upgraded to wordpress 5.0 and not all text in Gutenberg is translated to my website's language German and stays in English. I already tried disabling all my plugins and switched to default ...
1
vote
0answers
10 views

update_post_meta attachment_image_alt description for Gutenberg

I have resolve then 2016 with this solution update_post_meta for custom field not working upon form submission But for wordpress 5.0 with Gutenberg only in Media work, if upload the photo with block ...
0
votes
0answers
21 views

How to add classes and events to image in javascript using Gutenberg?

Before WordPress 5.0, manipulating the content in the editor using javascript was fairly easy: add_wp_tiny_mce_init_script to add your script in the TinyMCE iframe profit The script I include in ...
0
votes
2answers
39 views

How to change text size of Gutenberg editor

Is there a setting in WordPress Gutenberg editor to change the font size of the text we type while writing posts? I mean the text size inside the editor itself, not the published text that blog ...
0
votes
1answer
15 views

How to check if current admin page is Gutenberg editor?

Previously I could use is_gutenberg_page(), but this function seems to be gone after 5.0 release. Any tips on how to check if current admin page is gutenberg editor?
2
votes
1answer
31 views

Gutenberg moving core blocks between categories

I've restricted a number of the default core Gutenberg blocks as many are unnecessary for my clients and will just add to the confusion of having the new editor. The result of this is some core ...
0
votes
1answer
21 views

What are the reasons to not use Gutenberg? [on hold]

I've recently trialled Gutenberg and found it quite nice. I understand there may be some compatibility issues, but was wondering if someone could outline what are the reasons to not use Gutenberg?
3
votes
2answers
688 views

How to disable Gutenberg editor?

As the 5.0 is getting real, and so is Gutenberg... Is it possible to disable Gutenberg and use previous TinyMCE editor? How to do this?
1
vote
1answer
32 views

How to add custom style to Gutenberg?

In my Classic Editor, I have loaded a few custom styles, which can be selected from an additional "Format" dropdown list. They are included into an editor-style.css. Now, in Gutenberg, that dropdown ...
2
votes
0answers
29 views

Modifying the Gutenberg Button Block

I am trying to learn how to use Gutenberg and would like to start with a simple plugin to modify the built-in button block. Basically, I'd like my plugin to do two things. One - modify the ...
3
votes
1answer
47 views

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

I would like to access the current post ID from within a block. According to this documentation page, it seems like I should be able to get the post ID with: wp.data.getCurrentPostId(); // or wp....
6
votes
2answers
2k views

How to detect the usage of Gutenberg

The new editor called Gutenberg is here as plugin in 4.9, and as core functionality called Block Editor, in 5.0. Regarding to it, it is often needed to determine programmatically which editor is used ...
2
votes
0answers
25 views

Add Formatting Buttons to Gutenberg core/paragraph BlockControls

When inserting a core/paragraph block to the content, we can choose e.g. "bold", "add link" from the controls above the content: For my customer, I would like to add formatting buttons for <sup>...
0
votes
1answer
24 views

Uncaught TypeError: wp.apiFetch is not a function

I'm working with the latest Gutenberg and WP and until last week, the code below worked as expected. const postSelections = []; const allPosts = wp.apiFetch({path: "/wp/v2/featured-post"}).then(fps =...
1
vote
1answer
27 views

Gutenberg & Pre-formatted Templates: Core Block Attributes

The Gutenberg Handbook currently has a short entry for creating whole templates of blocks, e.g. used for Custom Post Types or just pre-formatting posts. https://wordpress.org/gutenberg/handbook/...
2
votes
0answers
34 views

Edit srcset and sizes attributes in Gutenberg image, cover and gallery - blocks

I am looking for a way to adress the responsive srcset and sizes attributes on Gutenberg image blocks - like image, cover and gallery. Usually one would do this with the '...
0
votes
0answers
17 views

How to fix Gutenberg with SiteOrigin page builder deleting content when editing

Our company has a custom built theme based on SiteOrigin's Pagebuilder. We've implemented a single-column site with 14 sections and scrollspy navigation. Since Gutenberg got pushed out the editing ...
2
votes
0answers
26 views

Creating conditional blocks for WordPress Gutenberg

I've been reviewing tutorials on creating blocks for Gutenberg but I am unclear how to handle a particular use case - conditional blocks. I am looking at creating a custom post type for which I will ...
0
votes
1answer
24 views

Instagram URL is converted into oEmbed

I have 8 Instagram URLs in this post out of which 3 are not converted into embed/iframes. I'm using Gutenberg's Instagram embed blog to add the URL's.https://blog.wwf.sg/ocean/2018/11/netflix-...
0
votes
0answers
15 views

Attachment Size Gutenberg

I use the Gutenberg Editor in Wordpress and I will show the attachment size next to the download button on the frontend. Is this possible?
0
votes
0answers
79 views

Show or hide custom meta box not work with Gutenberg

I’m on WordPress 5 beta 4, the problem is that meta boxes can not hide them when selecting a specific template chosen by page attributes. To make them appear or hide, you have to update the browser ...
1
vote
1answer
42 views

Gutenberg: unable to save attributes with ServerRender

I'm struggling since 3 hours with this problem and I do not see an end. Problem: I try to display a post_meta value in the Frontend with the ServerSideRender. The Value is Displayed in the Gutenberg ...
0
votes
0answers
35 views

What is your strategy to prepare for Wordpress 5.0 and Gutenberg?

Our office has quite a few businesses with Wordpress websites. Even though we have hired people who know how to work with Wordpress, no one has done any training in preparation for Wordpress 5.0 and ...
2
votes
1answer
79 views

Hide or show Gutenberg custom block using date range

I have created a custom block with a dateFrom and dateTo attribute (which work), but would like to hide the block on the front end between these dates. Not sure if this is even possible? I don't ...
0
votes
1answer
46 views

WordPress Gutenberg, update post content programmatically

I have been starting to testing out Gutenberg editor with both ACF and custom blocks. And I have been looking around to solve my problem but I couldn't find anything about this topic (Maybe my google ...
0
votes
0answers
26 views

Function passed to withSelect not executed

This is about the new gutenberg functionality: When inside the js of my block and I try to load data with withSelect the code bellow doesen't get executed. Any idea why? const test = withSelect( (...
2
votes
1answer
168 views

Trigger Javascript on Gutenberg (Block Editor) Save

So I have a metabox which I want to trigger some Javascript when a post is saved (to refresh the page in this use case.) In Classic Editor, this can be done via a simple redirect hooked to save_post ...
3
votes
1answer
89 views

How would I get a taxonomy/category list inside a Gutenberg block?

I would like to display a dropdown list of categories (or other taxonomy) inside of a Gutenberg block. I can only think of two ways to do this: Create an array of the taxonomy in php and use ...
1
vote
0answers
47 views

How to Add a Container Class to Standard Gutenberg Blocks

I am using ACF fields to create custom Gutenberg Blocks. I am running into an issue however where I need to go in and out of a container div depending on the block. So I cant just add a container div ...
4
votes
1answer
71 views

How do I enqueue a script to run inside the Gutenberg editor?

I'm using the Gutenberg editor as a replacement for a whiteboard in a classroom. I'm able to make the classroom more interactive by having students work directly inside the Gutenberg editor. As a long-...
0
votes
0answers
14 views

Access state in parent higher-order component

I'm trying to develop a WordPress Gutenberg block here. How can I reformat my code to be able to have access to the searchTerm state (defined in the class) in the parent higher-order component defined ...
0
votes
1answer
60 views

How to disallow a certain custom gutenberg block outside of an InnerBlocks block?

I did add a custom block as an InnerBlocks block, called slider. Then i got another custom block slider-item. I think you get the idea. The slider block just allows slider-item as it's child blocks. ...
1
vote
1answer
42 views

Define multiple Gutenberg editor widths

I'm trying to define multiple widths for the Gutenberg editor depending on the post/page template. I have a full-width page template and would like the editing experience to be as close to the live ...
0
votes
2answers
46 views

For developers, what impact can we expect Gutenberg to have on the loop?

I appreciate that the question in the title may be a little bit vague. So far, my understanding of Gutenberg's longer term implications are: i) WordPress will ultimately evolve into an entire front-...
1
vote
0answers
45 views

Gutenberg: Get All Attributes From «core/image» Block

For design/functionality reasons, I would like to change the output of the core/image block on the frontend. I know could do it like this, but it a little bit heavy: PHP: // add my own render ...
3
votes
1answer
96 views

Gutenberg - how to correctly perform ajax request on backend

I have simple block with server-side rendering on frontend. PHP: register_block_type( 'some/block', array( 'render_callback' => 'render_my_block', 'attributes' => array( '...
0
votes
0answers
43 views

Setting HTML properties in a Gutenberg plugin using WordPress settings

I want to set the maxlength property on a TextControl I define in a Gutenberg plugin. This length is to be set from a setting in my WordPress plugin (the one that loads the Gutenberg plugin). I ...
0
votes
1answer
134 views

Gutenberg Edit Block Inspector Controls and save

I am looking to edit an existing block to add inspector controls that save as meta data. I have been beating my head trying to find how to save the data. The following code adds a text field to the ...
0
votes
1answer
69 views

How to disable align-wide for specified blocks in Gutenberg

I added support for align-wide to my theme, but I don't know how to disable this feature for some existing blocks. I check Gutenberg documentation but I can't find solution. add_theme_support( '...
3
votes
0answers
59 views

Gutenberg: Is there a way to know if current block is inside InnerBlocks?

So I am using nested blocks in Wordpress Gutenberg. I am applying a wrapper on my elements that apply a bootstrap container class. Obviously I'd only want that on the outermost blocks, not on the ones ...
0
votes
1answer
56 views

How to get color name in PanelColorSettings in custom Gutenberg block?

I am developing a custom Gutenberg block with the PanelColorSettings component to set up the background color, here is my code <PanelColorSettings title={ __( 'Color Settings' )...