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

Block UI data table

I need a simple editable table in the sidebar (inspector) part of block with two text fields for entering values and possibility to insert or delete row and possibly move it to another position. ...
  • 466
0 votes
0 answers
8 views

Can I strip WordPress classes from blocks?

The block editor adds some unnecessary code. For example, choosing a blockquote doesn't just add a blockquote... it adds a blockquote with the class of wp-block-quote. This is unnecessary, of course. ...
2 votes
1 answer
92 views

Gutenberg and custom blocks messed up pagespeed score. What did I wrong?

I built a plugin that adds a few custom blocks to guenberg and built a website using gutenberg. Today I wanted to test it with page speed insights and found out that my website has now a lot of render-...
0 votes
0 answers
10 views

Block validation: Block validation failed

When I load the backend Gutenberg editor, I receive a console error: Block validation: Block validation failed Content generated by `save` function: <The correct HTML content......> Content ...
  • 1,588
1 vote
0 answers
34 views

How can I avoid setTimeout and redundant getEntityRecord calls in a block editor sidebar?

I've been struggling with getCurrentUser, getEntityRecord, and editEntityRecord and am wondering how I should be using them. It's for a sidebar that submits a prompt to OpenAI and then returns it. It ...
1 vote
0 answers
22 views

Gutenberg's Popover component position relative to the focused element

I am developing a site where we want to use Gutenberg's Popover component to show custom options in the Popover when a specific key is entered in the block editor. I have used KeyboardShortcuts ...
0 votes
0 answers
26 views

Wordpress "HTML editor" which doesn't trash hand-coded HTML?

I've been putting up with this for years, but it's just getting to be too much trouble. I'm on 6.0.1. If I select a page, and select the Code Editor, and make a trivial change, it can modify the HTML,...
  • 27
1 vote
0 answers
17 views

Table block variation with header section activated

I am attempting to create a default table variation with the header section toggled on. There is no boolean attribute to activate the header section it seems and instead it’s an array. I was able to ...
  • 11
1 vote
0 answers
14 views

Adding attributes to the core search block form

I'm trying to minimally hook (via a plugin) into the search form generated by the default search block and add a target="_blank" to open the results in a new tab. I'd much prefer to do this ...
  • 482
1 vote
0 answers
20 views

Correct way to make a custom block theme responsive

I am trying to make a custom responsive theme using the new Block / FSE approach however I dont think the method Im using is correct. This is the current design: This is the view in block editor: In ...
  • 111
0 votes
0 answers
21 views

Redirecting the user to the admin table area after publishing a post, getting an invalid response error?

I'm trying to redirect the user back to the custom post type page in the admin area after they publish a post but i'm always getting the error: Publishing failed. The response is not a valid JSON ...
  • 1
0 votes
0 answers
15 views

How to use react in frontend of dynamic blocks?

My goal is to use attributes defaulted I block.json or changed in block-editor in frontend. In block-editor everything works perfect. I can display attributes, change them, add new rows in array or ...
0 votes
0 answers
10 views

How to display dynamic block editor on front-end?

I use dynamical approach to display date in frontend of wordpress. In editor screen, every thing go perfect - I can change settings and publish it. When I go to another page there is a problem because ...
0 votes
0 answers
13 views

How to force package.json to create build some files?

I successfully created block-editor part of plugin but I have problem with my wordpress application because in build folder there is only index.js index.php files but there is not fronded.js files ...
0 votes
0 answers
29 views

How to edit post meta by post ID in Gutenberg

What is the best practice to do this in Gutenberg/JavaScript: update_post_meta( $page_id, '_custom_post_meta', 'Some data to be saved' ); I need to do this from a sidebar box Custom meta is ...
  • 183
0 votes
0 answers
20 views

How to use correctly Panel in block/editor?

I am using Panel from @wordpress/component and my problem is that, every time I click on PanelBody, it disappear and I cannot do anything. <Panel header="My Panel"> {acc.map((x)=>( ...
0 votes
0 answers
16 views

Passing object to FormTokenField suggestions

I know FormTokenField suggestions prop is for arrays, but what is the best way to go about it if I need to get the key value of an object? I want the objects keys values to show in the suggestions, ...
0 votes
0 answers
22 views

How to modify array of object in Gutenberg (block/editor)?

I want to create accordion plugin, my problem is that I do not know how to modify a state in array of object. my state in block.json "AccordationDate": { "type": "...
1 vote
0 answers
53 views

Wordpress Gutenberg: Attribute overwritten by block duplicate

For a custom wordpress gutenberg block I've created a list of buttons so that users can add/remove as many as needed. While this works pretty fine one issue occurs: When duplicating a block the ...
  • 111
0 votes
0 answers
20 views

How to list all registered blocks

This has been asked but I do not think it has been answered properly. There are two approaches to get all registered block-types, using PHP server-side and JS on client-side. The PHP wouldn't always ...
  • 103
1 vote
0 answers
20 views

How to add my theme's style to woocommerce blocks?

I have found plenty of articles on how to remove the styling from the Woocommerce blocks, but I can find nothing about how to actually use your theme's styling to replace the removed styling from the ...
  • 11
0 votes
0 answers
10 views

Insert gutenberg blocks into template

I've made various gutenberg blocks and I want to insert each individual block into my page template where I see fit. How can I do this? Is it possible?
1 vote
0 answers
13 views

Possible to use a block filter (blocks.getSaveContent.extraProps) with dynamic blocks?

I use a block filter to add classes to core and custom blocks. It doesn't work with dynamic blocks though. I tested with my custom block, and then tried with the core latest posts block and it didn't ...
  • 187
0 votes
0 answers
15 views

Multisite image URLs incorrect in editor

I've been driving myself nuts with this one, so I'm hoping someone might be able to help. I have a Multisite with the latest WordPress version set to subfolders. The issue I am experiencing is with ...
2 votes
1 answer
28 views

FormTokenField passing objects to value property

In the documentation it is noted that value property can be "...an array of strings or objects to display as tokens in the field. If objects are present in the array, they must have a property of ...
  • 183
0 votes
1 answer
20 views

wp-scripts start build hangs

I am trying the create-block part as in https://developer.wordpress.org/block-editor/getting-started/create-block/ But the 'wp-scripts start' command hangs and does not come out. I am using the latest ...
1 vote
1 answer
26 views

LinkControl not showing suggestions when used on admin page

My goal is simple, I'd like to use the LinkControl element on an admin page rendered by my plugin. Using the LinkControl on the BlockEditor page is quite easy the issue is doing it without being ...
  • 121
1 vote
0 answers
24 views

Can you programme the selected page template to display block patterns automatically?

Ideally, if I select a template called "3 columns", the block patterns layout I've premade would automatically load into place. I understand you can predetermine regular posts block pattern ...
0 votes
1 answer
20 views

No inline css, simple css file?

I'm struggling HARD to simply adjust css. Wordpress creates a lot of unneccessary inline css, with styles for every block of content. As of right now we’re up to ‘.wp-block-78’ or something like that, ...
0 votes
2 answers
33 views

Prevent FormTokenField component to accept random entries

FormTokenField component has suggestions property which provides a list of suggestions when user start typing. But, FormTokenField also accepts any value, if separated by comma, even if it is not ...
  • 183
0 votes
2 answers
21 views

Pullquote Block Styles disappeared?

Did the Pullquote block styles disappear in the editor? There used to be a Styles section in the sidebar panel with the "Default" and "Solid Color" options, as it is written in the ...
  • 307
1 vote
1 answer
33 views

How can I reintroduce autocompletion of Gutenberg components in Visual Code?

I have a development environment in Visual Code, in which I have a WordPress Theme, in which a Webpack process is watching my code changes through the integrated terminal. This process uses @wordpress/...
0 votes
1 answer
20 views

How can I reset/remove background colour from a block

So my block has background colour. Let's say it's a paragraph block. I want to remove the background colour completely, but can't find any way in Wordpress' Editor UI. The only way I found was to ...
0 votes
0 answers
11 views

Gutenberg Block to Select Category Term

I'm trying to create a block that will allow the editor to select a category term from a select box. When they have done this, I would like it to show the following within the block; category title, ...
0 votes
1 answer
15 views

How can I add a section with a different background color?

I've installed Wordpress on my server and I'm attempting to implement the design I've mocked up in Figma. It's a pretty simple design but it employs different colored sections to break up the content ...
0 votes
0 answers
15 views

Block editor - Too many requests for server host

I have a plugin that implements a custom post type that contains a fair amount of metadata associated with each post. When I edit a post from the admin page all of the controls on the right side of ...
0 votes
1 answer
31 views

Using `esc_attr( get_block_wrapper_attributes() )`, results in `class=""wp-block-foo""`

So, phpcs is telling me I need to escape the get_block_wrapper_attributes(); function. I thought it would be a simple as esc_attr( get_block_wrapper_attributes() );, but it would appear not to be the ...
  • 213
0 votes
1 answer
20 views

Error: "Sorry, this content could not be embedded" when using the Embed block

When trying to embed a URL to another post on my site, I received the "Sorry, this content could not be embedded." I had never had a problem before and always ended up with a nice preview ...
0 votes
0 answers
19 views

Accept only PDF file for upload

When I initially use the MediaUpload component and I choose to upload an image, it only lets me upload a PDF and all other files types in my computer file manager are greyed out. This is good. However ...
0 votes
1 answer
69 views

Render raw html in Gutenberg block

I want some custom html-block like <table> <tr> <td>1</td> </tr> </table> to be rendered in my block, that I register using registerBlockType. Therefore I ...
  • 101
0 votes
0 answers
9 views

get the queried_object of an url

Let's say I have an url for exemple in gutenberg content that is like https://www.exemple.com/my-tax/my-term-name or https://www.exemple.com/en/my-rewrite_tax_slug/my-term-name or https://www.exemple....
0 votes
0 answers
10 views

How to generate WordPress core blocks markup programmatically?

I am migrating a site's content to a newer WordPress-based site and I am able to parse the content to an array-like structure where I have HTML element info, related attributes, and data. Now, I want ...
  • 23
0 votes
0 answers
15 views

fetch more than 100 records in block editor API call

This question is related to this one, however, I am searching for a way to do this in block editor. I have this custom React hook which fetches records from custom post type: export function ...
  • 466
0 votes
0 answers
9 views

Change order of the block editor's panel

Does anyone know how to change the order of block editor's panel?
  • 335
0 votes
0 answers
7 views

How do I change search input padding for blockbase child theme?

I am using a child theme based on blockbase. I need to change the padding on the search form. The CSS variable is --wp--custom--form--padding. The class is .wp-block-search .wp-block-search__input { ...
  • 101
1 vote
0 answers
16 views

How to link ACF relationship field to the new Query block in Full Site Editing

I am using the new Query block on WordPress Full Site Editing and I am trying to figure out how to connect that to the ACF relationship field. So I have an ACF field on my category that allows the ...
0 votes
1 answer
30 views

How do I add custom CSS animations for specific Gutenberg blocks?

I am not building a theme from scratch and am using a given Wordpress template that allows for full site editing with Gutenberg block editor. I have been able to add custom CSS (using the Additional ...
1 vote
1 answer
55 views

How to disable blocks in Gutenberg editor for specific post type

I want to hide some blocks based on the post type. At first, I thought it's possible to hide them by going to Editor > Preferences > Blocks > Visible blocks and toggle them, but noticed that ...
  • 133
0 votes
1 answer
26 views

Enable varying text for Phone, Tablet and Desktop

I've seen a few Gutenberg blocks, consistent between developers, where the user can define different data for different views, as this user references: However their build files are, of course, ...
  • 539
0 votes
0 answers
35 views

Refresh server side rendered block in Gutenberg without changing attributes or its content

I developed a free block called "SimpleTOC". It uses server side renditions in php. I added the feature that it refreshed itself everytime the user saves the post. I do this by updating an ...
  • 601

1
2 3 4 5
32