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
1answer
6 views

Gutenberg build error: You may need an appropriate loader to handle this file type SCSS

I had a plugin up and running with a scss to css compiler. Suddenly after I moved a few files into a better structure I get this error while building the block: ERROR in ./blocks/random-game/src/style....
0
votes
0answers
8 views

Gutenberg Blocks and get_option() for styling

I'm creating a Gutenberg block and I'm trying to customize a button's style (background color, text color, etc.) and it's inner text with hexcode set in an options menu. What's the best way to access ...
1
vote
0answers
10 views

Is it possible to access the wp-admin from one instance while keeping WP_HOME pointing to the balancing url?

I have a Wordpress running in a load balancer scheme with two instances. For security reasons, i've decided to block wp admin access from the public url and allowing it from one of the instances. ...
1
vote
1answer
19 views

Correctly handling WordPress core data retrieval in Gutenberg

I'm attempting to get the ID for either a tag / category by slug name within a Gutenberg sidebar plugin. I created the below function, but am still struggling with the results coming back null the ...
0
votes
1answer
24 views

How to add InnerBlock multiple times in the same block

When I click a button to add a new tab, I would like to have an <InnerBlock /> so I can add other blocks within the tab. Trying this does not work as the same seems to be in all the dynamically ...
1
vote
1answer
13 views

Gutenberg: How to update associated Terms of Custom Taxonomy to Current Post

I have successfully created a custom Gutenberg block which can modify several meta data and native post data. Among other, I've built a dropdown with all the terms of a custom taxonomy (with ...
0
votes
0answers
27 views

How to create nested array attribute

I want to create a nested array attribute but not sure how. I think the JSON would look something like this. I want to have a tab with multiple tiles inside each tab. { "tabs": [ { ...
0
votes
1answer
26 views

How to prevent Block Editor from adding id to block markup in save function?

I am extending a core WP block (core/group), so that it has some added div's enabling me to display the block as I desire on front end. In addition to the display customization (which is not possible ...
1
vote
1answer
23 views

How do I dynamically render an InnerBlock inside a dynamic block?

I am building a custom website with custom blocks and have recently decided to translate all my blocks into dynamic blocks. The blocks that do not use InnerBlocks are fine, but I cannot figure out how ...
0
votes
1answer
34 views

How to only load css for used blocks on frontend

I am trying to figure out how to only use css for the block/blocks actually used on the frontend. With my current setup everything is bundled into my build/frontend.css file and so just using one of ...
1
vote
1answer
19 views

Gutenberg: how to hide server side render output in the editor but keep it in frontend?

My goal is to use the Gutenberg Block for the backend editor to collect the data but output it only with php. I added a server-side-render component to my block. Now I can edit attributes in the ...
0
votes
0answers
14 views

How to create Gutenberg patterns and patterns categories based on CPT posts and CPT terms?

I've created custom post type called ml_patterns and assigned custom post taxonomy called ml_patternsCustomTaxonomy. What I want to do is create custom Gutenberg patterns and custom Gutenberg's ...
0
votes
0answers
20 views

How to create Gutenberg's pattern category automatically with custom post taxonomy terms?

I’m trying to create pattern category form each custom post taxonomy term that is assigned to post in custom post type ml_patterns_. Actually I have 3 posts with different terms. Code: $patternsTerms =...
1
vote
1answer
23 views

How to makes Custom Post Type posts as Gutenberg's patterns?

I've created custom post type ml_patterns_. Now, I want to use each of post as a separate Gutenberg Block Pattern. So for that I've created this: $args = array( 'post_type' => 'ml_patterns_', ...
0
votes
1answer
11 views

Filtering Gutenberg Components, not Blocks

I'm currently wondering if it's possible to filter Gutenberg Components, instead of Blocks. For example, I need to add a new item to every DropDownMenu component, which could be achieved by changing ...
0
votes
1answer
21 views

Gutenberg: How to display meta field data in the block frontend (save function)

I have some legacy meta fields in my post that I would like to display in my block. I found a documentation for settings meta fields but not how to display them. So I tried this: export default ...
0
votes
0answers
32 views

Gutenberg Block: Query for posts with blocks and sort by attributes

Before Gutenberg I added meta_fields like "_my_integer_value" and added them to the post. I could query with something like this: $args = array( 'post_type' => 'post', '...
0
votes
1answer
18 views

Gutenberg: How to use RangeControl in the editor itself and make it work?

I tried to use the RangeControl component outside and in the block editor itself. But it looks like there are styles missing, and it does not work properly. Is there a trick to use it in the block ...
0
votes
0answers
33 views

Is there any way to parse blocks inside widget area?

As widgets are outside post content, i couldn't find the way to parse blocks inserted inside widget area for ex. "sidebar-1" We use something like below for parsing post contents, $post = ...
2
votes
1answer
26 views

How do you use __experimentalLayout to give innerblocks alignment control and default layout?

As referenced in this issue ( https://github.com/WordPress/gutenberg/issues/33374) I want my custom block's innerblocks to have the default layout and alignment controls Like the layout toggle for the ...
0
votes
1answer
17 views

Show popover with url and option to open in new window

I am creating a custom block and I want to show a button which the user can edit the text of and I want them to be able to select a page/enter a link. I have this working but using URLInputButton does ...
0
votes
1answer
53 views

How to create multiple Gutenberg blocks in one plugin

I have created a custom block and can create another one in the same plugin but it will get messy if I carry on because everything has to be done in the same index.js file and php file or so it would ...
1
vote
1answer
30 views

How can I access the attributes of a block within InnerBlocks?

Let's say contains a core/gallery block inside which I want to render on my own. How can I get the gallery ID or the Image IDs in the server-side render.php? block.js: const { Gallery, ...
0
votes
0answers
16 views

apiFetch() returns infinite requests

In PHP I created a a simple endpoint to return an array of custom post type names: // Create array of custom post types function custom_get_post_types( $data ) { $args = array( 'public' =&...
1
vote
1answer
15 views

WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal

I have a plugin with import import { __experimentalUseInnerBlocksProps as useInnerBlocksProps } from '@wordpress/block-editor'; but it's not working with newest Gutenberg plugin 11.9, because this ...
1
vote
0answers
15 views

Including users in insert link internal link search in Gutenberg

When I select text and insert a link in WordPress admin using Gutenberg, WordPress searches for internal pages based on the link text. It returns posts, custom posts etc., but not users. I found some ...
0
votes
1answer
19 views

Use npm and wp-env to make production bundle

Does anyone have a webpack config modification or @wordpress/wp-scripts extension that takes npm run build and then bundles everything up into a nice little .tgz or .zip without all of the extra ...
0
votes
0answers
17 views

Gutenberg getMedia() in post query doesn't return all featured images

In my edit() function for a custom block I'm using the following to list my post titles and featured images: import { useSelect } from '@wordpress/data'; edit( { attributes, setAttributes } ) { //...
0
votes
0answers
14 views

How to Change the Gutenberg editor's colors?

I don't like the Gutenberg edit admin styling. I think Gutenberg has way too much whitespace and needs some color or at least shading. To be clear, I'm talking about the editor itself and not the page ...
0
votes
2answers
37 views

Gutenberg get index of gutenberg innerblock

I have a Quiz block that contains Questions blocks that have Answer blocks. Both Quiz and Question use InnerBlocks to allow questions or answers to be dragged around, edited and saved. When I save the ...
1
vote
0answers
17 views

InnerBlocks restricting does not work on nested blocks

I'm defining which set of blocks to allow in my custom innerblocks: const ALLOWED_BLOCKS = [ 'core/image', 'core/paragraph', 'core/group' ]; ... <InnerBlocks allowedBlocks={ ALLOWED_BLOCKS } />...
0
votes
0answers
13 views

How to Disable “Block Recovery” for HTML Blocks in Gutenberg

I'm trying to correctly process the following format in an article using Gutenberg: HTML BLOCK: <section class=”bg-wihite”> PARAGRAPH BLOCK: this is a test. HTML BLOCK: </section> But ...
0
votes
0answers
11 views

Wordpress does not hide content after "Read more" block added using gutenberg editor

I wanted to hide part of the content written after the "Read more" block added using Gutenberg editor. So I used this one https://gogutenberg.com/blocks/more/ But on the single post page, it ...
0
votes
1answer
27 views

Custom style css doesn't work in Gutenberg preview

I added custom CSS file to Wordpress blocks with add_editor_style( '/css/posts.css' );. The problem is this style doesn't work for mobile and tablet preview in Gutenberg Editor. Because Im using ...
0
votes
0answers
13 views

Debugging Gutenberg block with the React Profiler (React Developer Tools)

How can I use the Profiler in the React Developer Tools to debug blocks in the Wordpress block editor? When trying to load the editor with the Profiler tab open (in Edge or Firefox), I get the ...
0
votes
1answer
15 views

Can you make a custom gutenberg block that allows the gutenberg editor within it?

I'm looking to achieve basically a wrapper for a collection of gutenberg blocks. The idea is that I can apply some ACF fields to the wrapper and then allow gutenberg to do whatever it does for the ...
0
votes
1answer
25 views

Block error: post_taxs_obj is not a valid property of Object

One of our blocks has stopped working, I understand its probably due to the 'post_taxs_obj' not being included in the PHP register_block_type attributes but I'm not sure how to resolve this - can ...
0
votes
1answer
24 views

Gutenberg: Heading with subheading/paragraph

How can this be modeled with existing blocks or other means? I want a heading block and a paragraph block visually (and semantically, if possible and necessary) grouped together. Example: Circle ...
1
vote
1answer
33 views

Gutenberg custom block using only register_block_type() and HTML

I have the following core block HTML <!-- wp:group --> <div class="wp-block-group"><!-- wp:heading --> <h2 id="hello-world">Hello world</h2> <!-- /...
3
votes
1answer
37 views

What replaces wpColorPicker in Gutenberg?

With wpColorPicker available in color-picker.min.js, I was able to easily create color fields which simply display the color: When you click the field, a color picker appears: Now I want to do the ...
0
votes
0answers
11 views

Category panel does not open/show fully in block editor

A client, who has a site built in a builder-type theme, contacted me with an interesting problem. " "Categories" is there, but when I click the arrow to get the list, there isn't one.&...
0
votes
0answers
21 views

WordPress React re-rendering to many times

I am making a WordPress Guttenberg Block to fetch a post and display it's title. But it is giving me the error 301 which is: Too many re-renders. React limits the number of renders to prevent an ...
0
votes
1answer
30 views

Gutenberg: always show text color selector in editing bar

For the Gutenberg editor, is there a setting, a code-behind change or any other way (if necessary, a plugin, but I'd rather avoid that) to always show the "text color" menu item when editing ...
1
vote
1answer
20 views

How to get featured_media of a post with getEntityRecords?

I am trying to get a specific post featured_media with getEntityRecords. but I couldn't. select("core").getEntityRecords("root", "media", { post: 92 })
0
votes
1answer
23 views

Creating Block templates with 'core/heading' other than level 2

Whenever I attempt to define a level other than H2 for 'core/heading' in any block template, upon reload of the page editor, the block gets a "This block contains unexpected or invalid content&...
0
votes
0answers
27 views

How to set up page fields with gutenberg instead of ACF

I have always developed sites using such a development flow: Wordpress installation + a blank theme (underscores theme) + ACF. Creation of the site structure (pages, custom post types, articles, ...
0
votes
0answers
20 views

Gutenberg get list of all custom image sizes

I added custom image sizes in my WordPress theme: add_action( 'after_setup_theme', 'wpdocs_theme_setup' ); function wpdocs_theme_setup() { add_image_size( 'custom-size-1', 120, 120, true ); ...
0
votes
1answer
21 views

@wordpress/components Button variants not styled

Whenever I import the Button component... import { Button } from "@wordpress/components"; ...and then use it with a variant: if (attributes.imageId) { return ( <Button variant=&...
0
votes
0answers
26 views

Exclude certain Gutenberg blocks from search results

I have a site that I have built using a series of ACF Gutenberg Blocks. The issue I have is when the search functionality is used. Searching obviously goes through the_content() to find appropriate ...
0
votes
0answers
34 views

Refresh Gutenberg with JS for it show updated post

I updated the post content after the saving. Let's say I am replace apple to banana. function apple_to_banana($content){ $content = str_replace('apple', 'banana', $content); return $content; } ...

1
2 3 4 5
27