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
0answers
11 views

Two content editors (gutenberg blocks) on the same page

Can I have an extra content-editor for blocks on the same post/page? I need to have two sections of blocks to realize the design I'm working with.
0
votes
0answers
6 views

Custom Gutenberg block incorrectly rendering dynamic fields

I have three "sections" of my Gutenberg block, two of which are working fine (basic text input fields). The third, I'm assuming the issue is with rerendering edit/save states. Number of options ...
0
votes
1answer
11 views

Possible to add the title of a custom gutenberg block to the edit screen?

I've create custom blocks for my client's theme and I want the title of the block to show after it's been added so that they can see which blocks have been used. This way they know how to recreate the ...
2
votes
0answers
27 views

@wordpress/hooks use to add actions/filters within multiple plugin

I am trying to use @wordpress/hooks package in one of my react based plugin. I have added some hooks(filters/actions) and I need to hook into these from different plugin. I am able to add filter for ...
0
votes
0answers
11 views

Add Gutenberg editor in post tag page and product tag page

i want edit tag page(blog tag page & woocommerce tag page) with gutenberg. I now add this code for editing product with gutenberg: function wplook_activate_gutenberg_products($can_edit, $...
0
votes
0answers
12 views

Use image block functionality in a custom block

I'd like to display an image that my block creates. Ideally I'd like to allow the user to resize and crop the image, etc., but not allow them to change the image to another one in the media library. ...
1
vote
1answer
23 views

Remove block styles in the Block Editor

The Block Editor recently introduced block styles as seen below: How do we disable these?
0
votes
1answer
25 views

Update block once an API request returns with a value

I've got a block that allows the user to enter a script when in edit mode, then sends this script to a REST endpoint which returns a WP_Post representing a media file which is then displayed to the ...
0
votes
0answers
15 views

Gutenberg Blocks Messes Up Layout?

So we designed a page that includes a section where featured news articles are displayed. The most recent article is displayed on the left side, while the other recent articles are displayed on the ...
0
votes
1answer
47 views

Get post from custom REST endpoint in Gutenberg

I'd like to get a post object from a custom REST endpoint within a Gutenberg block. The REST endpoint returns as part of its JSON payload an array with a "post" key which contains the contents of the ...
0
votes
0answers
26 views

Gutenberg - dynamically created element: how to set onChange?

having blocks with many attribues, I'm trying to optimize the code to write things just once. Because of this I created a PHP array used for default attributes in register_block_type() I pass it ...
1
vote
2answers
55 views

How to return a list of custom taxonomy terms via the Gutenberg getEntityRecords method

This method for @SE How would I get a taxonomy/category list inside a Gutenberg block? does NOT work for custom taxonomies, e.g.: wp.data.select('core').getEntityRecords('taxonomy', 'my-custom-...
0
votes
1answer
29 views

Did Gutenberg block editor change the html in post content during import?

Which HTML is better, pre-Gutenberg or post-Gutenberg? I imported post content from an old and large WP site into a fresh install and new database. Almost 1200 posts along with their meta and related ...
0
votes
0answers
15 views

Editor Sidebar CheckBox Function

EDIT: I am looking for an example function to put a checkbox in the sidebar of the editor. I prefer to copy/paste without needing to learn Java-Script first. See below for more details. The Problem ...
0
votes
0answers
16 views

How to activate a new prop that a block introduces in a new release?

I'm using this plugin called Simple Code Block to display code snippets. In a recent release, it got a new toggle prop that displays a copy button on top of the code block but it must be turned on for ...
6
votes
0answers
134 views

How would one modify the filtering Gutenberg applies to pasted content?

Note: I'm adding information I discover that seems to be leading to a resolution in the note. The Problem: When pasting content from outside of Gutenberg (e.g., Google Docs) into Gutenberg, some ...
0
votes
1answer
25 views

Style Gutenberg metaboxes like they belong on the site

When you add a meta box to Gutenberg, it looks different than the other items in the editor. There is a HR, and the fonts are different. Does anyone know how to fix this so it looks like a natural ...
1
vote
0answers
14 views

How do I replace a audio gutenberg block to native audio wordpress

I am developing a blog theme, I would like to change the output of the audio gutenberg block to native wordpress. Any hint Gutenbergs output: <audio controls="" src="http://photer/wp-content/...
1
vote
0answers
28 views

Why is this gutenberg custom format button only available from the toolbar as a dropdown?

I have a very simple custom format button for Gutenberg. JS code is as follows: (function ( wp ) { // Create our button. var lqdNotesButton = function( props ) { return wp.element....
0
votes
1answer
33 views

How can I allow HTML in Gutenberg UI elements help text?

I like to know how can I add clickable links to help text? el( ToggleControl, { label: 'Toogle', help: '<a href="https://.." >This will be escaped, I do not want that<...
0
votes
1answer
25 views

How to display InnerBlocks in render callback

I have a block that copies the functionality of the "Columns" block. My problem is that I don't want to use the default save function, but to use a callback function. As I'm using InnerBlocks my edit ...
0
votes
0answers
9 views

Gutenberg plugin and flickity carousel

I recently started using the Gutenberg plugin for its group block, that is not (yet?) available from Wordpress' native Gutenberg editor. I also often use Flickity carousel. Lately, it started to show ...
0
votes
0answers
15 views

Block editor: How to check if block editor has initialized and populated the data store?

Within some JavaScript I have to get the current post content of Gutenberg. I am accessing this from jQuery (might be bad practice, however): $(document).ready(function() { const { select }...
0
votes
1answer
28 views

Block Editor: How to get title and post content within the WordPress admin UI in Javascript?

Adapting some old SEO module (which was written for TinyMCE) I have to access the current post title and post content via JavaScript. I have been avoiding Gutenberg in the past, but it seems like this ...
1
vote
1answer
28 views

How can I get the selected string when using a toolbar button in Gutenberg?

I have added a button to the Block Editor. Currently it adds a <span class="lqdnotes-blank-it"> before the selected text and </span> after it like so: <span class="lqdnotes-blank-it"&...
0
votes
0answers
21 views

Enable opacity to Gutenberg Color Palette

How to add opacity to gutenberg color palette like this: <BaseControl className="editor-color-palette-control block-editor-color-palette-control" > <BaseLabel className="...
2
votes
1answer
39 views

Gutenberg Reusable Block of WordPress

I'm using an custom theme and I would like to take the id to the values ​​of a reusable block. I have this code: <?php $post = get_post(); if ( has_blocks( $post->post_content ) ) { $blocks =...
0
votes
0answers
16 views

Dynamic media queries with CSS inside PHP file

I'm currently developing a WP plugin (specifically a set of Gutenberg blocks), in which I would like to have the ability to set a series of breakpoint values through the plugin options, to later be ...
0
votes
0answers
20 views

Gutenberg blocks not full width

I am having an issue where an image block in Gutenberg editor is not the full with of the page even though I have selected "Full Width" in the back-end. Is there a way to fix this? Image for ...
2
votes
0answers
9 views

Gutenberg reusable blocks - is it possible to customise an instance?

Is it possible to have custom settings for a particular instance of a reusable block? If you change any settings/data for a reusable block it changes for all instances where that block is used. This ...
0
votes
1answer
12 views

A query to substitute images paths in gutenberg (website migration)?

I was used to do something like update wp_posts set post_content = replace(post_content,'http://dev.example.com/website', 'http://www.website.com'); This seems not to work anymore for texts that ...
1
vote
0answers
26 views

Gutenberg List Extension Block

I'm trying to extend the default Gutenberg unordered list that renders like this; <ul> <li>Item 1</li> <li>Item 2</li> </ul> To something like this when ...
2
votes
1answer
54 views

Gutenberg: useDispatch is not a function - @wordpress/data included

I have the @wordpress/data package installed, but I can't use useDispatch in my block edit function: const { registerBlockType } = wp.blocks; const { useDispatch, useSelect } = wp.data; . . . ...
1
vote
0answers
20 views

How to get an array of custom blocks by block name

Scenario: I have created a custom block that outputs a list of posts, with control over number of posts, and the taxonomies where the posts can be selected from. The custom block is nested inside a ...
0
votes
2answers
33 views

How to change the width of certain paragraph or header blocks?

Most of the time I like having the blocks the full width of my site (https://princetonfireandsafety.com/), but sometimes I just want to have a single header or paragraph block that isn't that big. ...
0
votes
0answers
20 views

How to center entire columns on a page, and have it stay responsive?

Page in question: https://princetonfireandsafety.com/contact-info/ I just want the two columns to be centered in the page (but the text left-aligned still). I would prefer to use the columns block ...
0
votes
0answers
10 views

Load image only when scrolled into view?

I have a long page where I want images loaded only when they first come into view. I saw this: https://stackoverflow.com/questions/2321907/how-do-you-make-images-load-only-when-they-are-in-the-...
1
vote
1answer
18 views

Insert SVG code (not img) in HTML block

I want to insert svg code in a Guttenberg HTML block. I don't want it as an image because I want to manipulate it with CSS. If I insert svg, all tag diseappears and I have only the text which was ...
0
votes
2answers
38 views

Set Multiple Meta Values as an Array Using dispatch( 'core/editor' ).editPost() Call in Gutenberg/JS

I'm attempting to store both an Image's URL and ID in a post's meta field via a Gutenberg component, but am having trouble figuring out how to store those multiple values in an array. I can store a ...
0
votes
0answers
26 views

Shortcode, vs blocks, vs templates - what would you do for choosing or creating custom post data in editor?

Say you have some custom post type. Call it my_type. Now say in Gutenberg, you want to either a. Insert some data into a my_type post from an existing instance of another_type where the inserted ...
0
votes
0answers
32 views

Deprecated function not working in Gutenberg

I'm change the default attributes: const blockAttrs = { avatarSize: { type: 'number', default: 120, // 70 -> 120 }, //other attrs }; ...
0
votes
0answers
13 views

Is it possible to get the position of the caret inside a RichText component?

Javascript can get the caret location of input and textarea elements by accessing the selectionStart and selectionEnd properties. Does anything similar exist for the RichText component in Gutenberg?
0
votes
1answer
25 views

How to use code in an editor block?

I am trying to execute code in a block such that I can display the title and description of a forum topic. I noticed that the Custom HTML block doesn't seem to allow me to execute PHP. What is the ...
1
vote
0answers
22 views

Is there an equivalent of the PHP function sanitize_key in Gutenberg?

In WordPress's PHP library there is a function sanitize_key used to generate database keys and HTML IDs. I'd like to generate a slug from a title that can be used as an HTML ID, from within a ...
0
votes
1answer
22 views

Gutenburg InnerBlock single child

I have a custom block called Custom Card that takes an InnerBlock as a child. The purpose of this is because I want to format the content within the Custom Card a very specific way. The Custom Card ...
1
vote
0answers
28 views

Gutenberg on an ACF options page

I would like to be able to add Gutenberg blocks to an ACF options page. I've been doing quite a bit of researching but have found nothing. For instance it would be nice to have a footer block and have ...
0
votes
0answers
12 views

Show Gutenberg facebook embed with a custom theme

I'm working on a custom theme, and I would like to display the facebook embed from Gutenberg in Wordpress. I've done parse_blocks and then printing the block displays just the facebook url. // page-...
0
votes
1answer
24 views

Pages are editable in Gutenberg, but posts are coming up in classic editor

I have a site where the posts are coming up in the classic editor, but should be in the block editor. The site is up to date with WordPress 5.2.3. The theme is based on TwentyTwelve. No "Classic ...
0
votes
0answers
10 views

Convert multiple image blocks to gallery block in Gutenberg?

Its easy to convert a gallery block into multiple image blocks. But how do I do the reverse? I have several older posts with a dozen or so images sequentially. I would like to display these all in a ...
0
votes
0answers
13 views

Images are not shown in the post editor

I created my posts with lots of images jut fine. If I open the editor after a while the images are not shown anymore. It's just showing a placeholder with the image title. If I open the image gallery ...