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
15 views

Wordpress block editor not working for pages and posts, but working for widgets

It feels clear to me, in my searching for an answer, that there is a file somewhere in the chain of launching the editor that has the default block editor being replaced with the classic editor. ...
0
votes
0answers
23 views

If is block name

I have an ACF block called “Image” (acf/image). Here’s a simplified version of how the template looks: <?php /** * Image Block Template. */ $image = get_field( 'image' ); ?> <img src="...
0
votes
0answers
16 views

Adding custom social icons to the social media icon block in the Gutenberg editor?

In wp-includes/blocks/social-link.php there is a function which seems to setup all the selectable icons in an array together with their names and their SVG code (lookie here on GitHub) Is there a way ...
0
votes
1answer
54 views

Are custom shapes of blocks available in WordPress?

I am using WordPress editor to make a page on my website. On the main page of my website, I want to keep pointers to at least ten other pages. I can see only some types of blocks in word press such as ...
0
votes
0answers
37 views

Wordpress 5.8 : display new widget

I've started a new website with the newest Wordpress 5.8. I've made a new widget thanks to the new widget builder which use Gutenberg block. In my functions.php register_sidebar( array( '...
0
votes
0answers
8 views

How to join Caption AND Description Meta Fields as one combined-caption in Image Block

Use case: Inserting Image Block (inapplicable for others, like Gallery Block). I'd like to use caption (post_excerpt) as real description of an image (what it shows), and also append additional info, ...
0
votes
0answers
27 views

Gutenberg Blocks - Save a predefined text attribute?

I am trying to save an attribute for a custom Gutenberg block. Call it contenttype. This attribute is already predefined - for instance, "discussion" In my code, I figured this would be ...
2
votes
1answer
25 views

How to define a Block Style in an Innerblocks template

I'm building a Innerblocks block template (in PHP) with the following syntax: $template = [ [ 'core/heading', [ 'level' => 1, 'content' => 'Example ...
2
votes
1answer
31 views

WordPress Gutenberg Theme: Structure, Hierarchy and Custom Templates

I'm starting to develop a WordPress theme using Gutenberg. I've never worked with Gutenberg before, but since the support for Classic Editor might possibly end next year, I want to use it now since I ...
1
vote
0answers
32 views

Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json

Since WP 5.8 we can define various settings in the theme.json which is much appreciated and really helpful. But there are still some options I cannot find, e.g. how can I remove the layout panel from ...
0
votes
0answers
47 views

Gutenberg Custom Block Not Validating - Ideas?

I added a Custom Block in Gutenberg (which basically customizes the Gutenberg Section block type that is made available by Ultimate Addons for Gutenberg), in Wordpress 5.7. It is a block I call let's ...
1
vote
0answers
20 views

How to prevent UNDO on guternberg block editor

I have one flag in my plugin, and when it active i want to disable UNDO function in post gutenberg editor. Can someone help me to achieve this ? Thank you.
1
vote
0answers
41 views

Can't run WP e2e-test-utils because the browser exits on login?

I'm trying to run e2e tests for my Gutenberg plugin. Here's my pertinent code import { createNewPost, enablePageDialogAccept, insertBlock, clickButton, } from "@wordpress/e2e-test-utils&...
0
votes
0answers
21 views

Trigger function on Remove block or add new block in Gutenberg JavaScript

I want to perform certain action, when gutenberg block is removed or new gutenberg block is added in post editor. How do i add lister to this two event in gutenberg javascript ? Thank you
0
votes
1answer
33 views

Can you use block patterns in block templates or insert them programmatically?

I'm working on a large web site with many custom post types and many block patterns, and each cpt has a suggested set & order of the block patterns. For my needs, the block template functionality ...
0
votes
1answer
16 views

useSelect in block Edit always returns default store value

given my custom store, when I try to use readItems selector, I am always getting default store state. Selector works fine (tested in console with wp.data.select), however, it takes some time to catch ...
0
votes
0answers
25 views

Using srcsets in a custom block

I'm building a few custom blocks and have come across something I am not sure is either possible at the current time (as there does not seem to be docs on it), or it is something people are still ...
2
votes
1answer
30 views

Programmatically trigger the gutenberg save

I have a load of data as JSON that I am trying to save into a fresh install of WordPress. I am using puppeteer to log into and create each page, and wp.blocks.createBlock to programmatically create ...
0
votes
1answer
14 views

Table block - Wrap table

I am using Gutenberg to create tables. Gutenberg tables have the following front-end structure : <figure class="wp-block-table"> <table> ... </table> </...
1
vote
1answer
46 views

Notices in the Block Editor with multiple lines

The page https://developer.wordpress.org/block-editor/how-to-guides/notices/ has the following code for adding a notice to the block editor: ( function ( wp ) { wp.data.dispatch( 'core/notices' )....
2
votes
0answers
16 views

Passing RichText attributes to function onChange

I have four RichText elements in a custom Gutenberg block I am developing, and they are all very similar except for the "name" attribute, which is currently hard-coded. What I need to do is ...
1
vote
0answers
28 views

Output content of post excerpt into Innerblocks within Gutenberg block

I'm building a Gutenberg custom block for pulling details from a custom post type into a Gutenberg block. In my use case, I have a custom post type of Exercises (which is a library of things like ...
3
votes
0answers
29 views

@wordpress/create-block image url in css

how to include image URL to css "style.css" in custom block? Both these not work: background-image: url("images/imagename.png"); background-image: url("./images/imagename.png&...
0
votes
1answer
31 views

Determine if a specific Gutenberg block is used on pages/posts

So we have built out a Gutenberg block that is acf_register_block_type as the name pardot-form. I want to build a widget to basically just display all locations of where that specific block is being ...
2
votes
1answer
12 views

.editor-styles-wrapper overriding my block styles in Gutenberg

I'm working on my first theme built from custom gutenberg blocks. I've managed to register blocks and enqueue their specific stylesheets, but I'm running into one issue that's kind of a pain. A lot of ...
0
votes
0answers
27 views

@wordpress/scripts advanced usage

I am trying to get all the JavaScript files that end in .jsx and compile them into Javascript files that end in .js in the same directory, using the @wordpress/sripts npm package. This is the script I ...
1
vote
1answer
39 views

Custom button block doesn't work

I am a beginner in creating Gutenberg blocks. I want to create a custom block for a button. It should have an input field inside for the button text and the user should be able to choose between two ...
0
votes
0answers
22 views

Custom Gutenberg color classes naming convention

The default behavior for the gutenberg blocks with color pallet is: The class name is built appending ‘has-‘, followed by the class name using kebab case and ending with the context name. https://...
0
votes
0answers
22 views

Disable or hide Gutenberg editor's Options button

To new or technically-challenged users the Gutenberg editor's many buttons and boxes can be overwhelming, and it strikes me that it should be within the dev's control to eliminate as much of this as ...
1
vote
1answer
39 views

How has my Wordpress editor become so basic? Cannot add blocks or see anything visual

I'm not sure how but it seems Gutenberg or the block editor has been disabled. I've tried several plugins to re-enable but nothing is doing any different. I only have 1 block showing up on pages (...
1
vote
1answer
57 views

How to set the localization for a Gutenberg block?

I'm trying to set localization for a Gutenberg block. After scaffolding a basic block with wp-cli command npx @wordpress/create-block, I need to set localization. I've create my pot file and ...
0
votes
2answers
29 views

How to disable Author dropdown in Gutenberg's Status and Visibility panel

I recently noticed a new feature in the Gutenberg editor (I'm guessing introduced in Wordpress 5.8) that seemingly allows any user to post as any other user: I confirmed that using this new option, a ...
1
vote
1answer
17 views

Function not working inside of a function in functions.php

I have the following function adapted from Christine's answer here that works perfectly on its own to hide panels/metaboxes in the Gutenberg editor: function irm_gutenberg_register_files() { ...
0
votes
0answers
30 views

Pass URL to iframe in WordPress Block

I have a WordPress site with an iframe that displays custom content from an external site. Here is my iframe code: <iframe src="https://www.targetsite.com/UNIQUECODE" width="800"...
0
votes
0answers
18 views

How convert Old Shortcode to Gutenberg block?

I have theme and plugins in website more that 70+ shortcode. Its very hard to write those code from start. Is there anyway to reuse HTML and save meta method for the same? add_shortcode('...
0
votes
1answer
15 views

WPGut - Updating failed and shortcode?

I have a problem updating the WordPress page with custom created shortcode and inserted it? Help, error status code: Updating failed. The response is not a valid JSON response. Shortcode: function ...
2
votes
0answers
31 views

How to insert text at the current cursor position in Gutenberg?

I am trying to insert text into Gutenberg at the current position for a speech to text solution. I am aware how to insert new blocks. const newBlock = wp.blocks.createBlock( "core/paragraph",...
1
vote
0answers
18 views

Multiple requests external data api dynamic block gutenberg

I have a gutenberg dynamic block that makes a request to an external api to return certain data to be rendered on the front. However, there are posts that have more than 15 blocks, that is, there are ...
0
votes
0answers
14 views

wp_instert_post() and Gutenberg update error

I have made page with function wp_insert_post(), $page_id = wp_insert_post(array( 'post_title' => 'Name', 'post_status' => 'publish', 'post_author'...
0
votes
1answer
118 views

Adding a size to core/image in an innerblocks breaks the save

I've a custom block which outputs a core/image block inside an innerblock. Everything works hunkydory until I attempt to sent a size to it. When I do, the block validation fails on re-edit: Block ...
0
votes
0answers
18 views

Add class to anchor links and other elements in a widget

I'm building a theme that follows the BEM methodology. I've added the following to functions.php: function nav_bem_anchor_element( $atts, $item, $args, $depth ) { $atts['class'] = 'header__nav-...
0
votes
1answer
18 views

Copying and pasting to Wordpress "code editor" code via the front end and clipboard

I'm trying to emulate what these folks do with their "Copy code" button: https://gutenberghub.com/templates/team-56 Their approach is great for copying to clipboard and pasting directly to ...
1
vote
1answer
56 views

ServerSideRender and Media Object: attributes passing image data object to php renderer even though it's not set

EDIT: Simply put, the issue I'm having is that the image data object (imgDataObj in the js), which is saved as an attribute in the JS side, is getting passed to the PHP side even though I'm not ...
1
vote
1answer
24 views

Is it possible to create column width presets in Gutenberg?

Gutenberg gives you some good choices out of the box but is it possible to add a custom preset? I understand I can change the columns manually but was hoping for a preset to make it easier on the ...
0
votes
0answers
19 views

styles work on the front end but not in the editor while extending a core block

I'm trying to add box shadow to the core group block. I'm using filters, since we are talking about extending a core block and not creating a block from scratch. The issue is that all works correctly ...
2
votes
1answer
33 views

Modify the InnerBlocks 'Add block' block appender label

I'm using the button appender as specified in the docs. // Utilise a predefined component <InnerBlocks renderAppender={ InnerBlocks.ButtonBlockAppender } /> By default the title of the ...
0
votes
1answer
48 views

How to add template colors to custom block options in WordPress Gutenberg editor sidebar?

Please have a look at the attached image for reference. I am building a block based plugin for the Wordpress Gutenberg editor. How can I add template colors (i.e., those black and pastel shades) to ...
1
vote
0answers
33 views

Unsaved changes in metabox inputs not detected in the block editor

I have added a custom field to the regular WP post type and added a meta box to the post editor as below (it is just an example with trivial checkbox): add_action( 'add_meta_boxes', '...
0
votes
0answers
40 views

Count Gutenberg blocks on the front-end?

Working on my 3rd project using Gutenberg blocks and have a requirement where I need to count the blocks in the loop so I can create, dynamically, a ‘jump to’ menu to various blocks, whatever order ...
0
votes
0answers
40 views

How to call a react hook on edit of registerBlockType?

I'm registering a block: block.js import { registerBlockType } from '@wordpress/blocks'; import Contents from './contents'; registerBlockType( 'spf/spf-design', { title: __( 'SPF Design', 'spf-...

1
2 3 4 5
25