Questions tagged [wordpress-gutenberg]

Gutenberg is the visual editor for WordPress. A question tagged wordpress-gutenberg should be related to usage or modification of the Gutenberg editor. These are best asked on Stack Exchange WordPress Development.

Gutenberg is the new visual editor for WordPress. Introduced in WordPress 5.0, it provides tools for creating more flexible and media rich posts/pages. Gutenberg posts are composed of "blocks" which can be inserted, rearranged, and styled to create more complex layouts and formats, while not requiring as much technical knowledge from your average user. Gutenberg utilizes the WordPress REST API and React.

A basic understanding of JavaScript frameworks, specifically React, is recommended for Gutenberg development, and more in-depth editing may require a primary knowledge of state management patterns, such as Redux.

Questions with this tag should be related to either using the new Gutenberg editor or modifying and extending the editor's default functionality (blocks, filters, formats, etc).

General Information: https://wordpress.org/gutenberg/

Gutenberg Handbook: https://developer.wordpress.org/block-editor/

Block API: https://developer.wordpress.org/block-editor/developers/block-api/

GitHub: https://github.com/WordPress/gutenberg

React: https://reactjs.org/

795 questions
4
votes
2 answers

Gutenberg repeater blocks using ESNEXT

I've been working on creating my own custom Gutenberg repeater block with a text & link input field. I've only seen ES5 samples like this and this. I've been working on creating my own version of those samples for close to 8 hours now and I'm…
4
votes
0 answers

How can I use serialized data in Gutenberg?

I am trying to create a Sidebar plugin that stores post meta to be used on the front end. Without getting into the unnecessary details, I need to store all the data as 1 meta entry instead of many rows per post. Here is what I have so far: //…
4
votes
2 answers

How to get the site root URL when using Wordpress gutenberg wp object

I just created my first gutenberg block plugin using the npm package create-guten-block. The edit function looks like the code you see below. But it gives a 404 not found on the apiFetch() call because the website lives in a folder, not in the root…
4
votes
1 answer

How is ACF Blocks data stored in the database

I just want to know how the data from Advanced Custom Field blocks is stored in the Wordpress database? As I understand it, the way that Gutenberg works, is that on document save, all data from all blocks is concatenaded in to one chunk of code, and…
4
votes
2 answers

How to use "getEntityRecords" for specific taxonomy terms

I'm trying to use "getEntityRecords" to get custom post types from specific terms of taxonomy. For "post" I can use "categories" attribute in "query" object, like below: getEntityRecords( 'postType', 'post', {per_page: 3, categories: [1,2,3] }…
4
votes
1 answer

Prevent wp.hooks.addFilter() from Running on Certain Custom Post Types in Gutenberg

I have been tasked with preventing addFilter() from running on certain custom post types using the new Gutenberg API and not any WP PHP. It's currently fed into the editor.PostFeaturedImage hook, meaning it fires every time the Gutenberg editor…
4
votes
1 answer

How to create multiple meta fields in gutenberg block

I need to create a wordpress Gutenberg block that will allow me to insert some data as name and surname, company name, the best sentence from the references. So far I managed to create a Gutenberg block that is saving one text field.…
Dariusz
  • 163
  • 1
  • 10
4
votes
1 answer

Include image assets in a WordPress Gutenberg Block Plugin

I am creating a custom WordPress Gutenberg block and I want to use image assets (PNGs, JPGs) from my plugin folder, to be shown in both the Gutenberg editor and on the rendered page. I am using Webpack to bundle my files for JS and SCSS. I tried…
Roman B
  • 140
  • 8
4
votes
0 answers

How to fix 'Error loading block: Invalid parameter(s): attributes' error in WordPress

I am attempting to extend an existing block which is registered in the Tasty Recipes plugin. I've added a control to the sidebar to handle selection of a given diet type, however when an option is selected, the following error is displayed: Error…
4
votes
1 answer

Updating Gutenberg global color palette in Javascript

I have a usecase where we need to update the Gutenberg global color palette after the page has loaded using javascript. I am aware of the add_theme_support('editor-color-palette', ...) PHP option but that will not work in this case. It seems like it…
P. Galbraith
  • 2,367
  • 18
  • 24
4
votes
2 answers

Gutenberg Editor Outside of Wordpress

The new wordpress editor is really cool at least I think so. I'm wondering if there was a way to get it for a plain HTML project or as like a package? So far looking around I've only found it associated with wordpress. If not then does anyone know…
Yasmin French
  • 816
  • 1
  • 8
  • 20
4
votes
1 answer

Registering multiple custom gutenberg blocks in a plugin with webpack build

I am working on a plugin that bundles multiple custom gutenberg blocks and I am using the @wordpress/scripts npm module to build with webpack. Works great so far, but checking the console when working in the editor gives me errors about blocks being…
Vortac
  • 408
  • 2
  • 8
4
votes
6 answers

Wordpress 5.0.3 - "Updating failed" and "Publishing failed". Console log shows a 404 on /blog/wp-json/wp/v2/posts/1177/autosaves?_locale=user

I updated Wordpress to the latest version (5.0.3). Now, any time I try to post I get a red message that says "Publishing failed". If I try to save a draft I get "Updating failed". In console, I'm…
Front_End_Dev
  • 1,154
  • 1
  • 13
  • 24
4
votes
1 answer

Section block with allow inner blocks in block editor, WordPress 5.0.2

I am creating a custom block name section, want to make it more power full with adding settings with different css properties. But stuck at the allowing blocks inside this custom block as column block does. here is what I done: // All blocks…
Jaydip Nimavat
  • 538
  • 7
  • 19
4
votes
0 answers

Run script right after adding a specific Gutenberg block

How to run a script right after adding a block? I'm adding map block using ServerSideRender but it only prints div with map id map-canvas. I want to apply var map = new google.maps.Map(document.getElementById('map-canvas') How I would apply it…
Rameez Iqbal
  • 335
  • 1
  • 3
  • 14
1 2
3
52 53