Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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/

0
votes
1answer
18 views

#038 appended to ampersand is breaking URL

Regardless of whether I add the Google API URL to my site inline using an HTML block or via the enqueue command in PHP, the following is being added to all of the ampersands in the URL which is ...
0
votes
0answers
16 views

extend Meta Box / Document Panel

For a project, I'm trying to figure out the best way to implement a checkbox, related to a post type. What I'm trying to to: On the final website, there should be a dropdown-button, with upcoming ...
0
votes
0answers
18 views

Style new block-editor alignfull class without scrollbars or overflow

With WP 5.0 you can now enable full width blocks in the editor by adding this to your theme: add_theme_support( 'align-wide' ); However, if you are using a custom theme you have to add your own CSS ...
0
votes
0answers
17 views

Can't get dynamic Gutenberg block to render on the frontend

I tried everything I found online. The backend appears, including dynamic segments (withSelect, etc). But the simplest 'render-callback' doesn't appear on the frontend. plugin.php /** * Plugin ...
1
vote
0answers
28 views

Change gutenberg categories checkboxes to radio input fields

Any ideal how to change gutenberg's categories checkboxes to radio input. I have tried using this plugin: https://wordpress.org/plugins/categories-metabox-enhanced/ but it does work fully well with ...
1
vote
1answer
25 views

How to check if post has Video or Gallery block in Gutenberg blocks?

I need to get information on front page about post - if it has gallery or video or both, how to find this information?
0
votes
1answer
12 views

Un-enqueue styles for certain built-in Gutenberg block types?

Is it possible to un-enqueue stylesheets for the built-in Gutenberg block types? e.g. I would like to add custom styles for the Gutenberg Columns block, so I'd like to un-enqueue the stylesheets just ...
0
votes
0answers
6 views

Gutenberg - editor-font-sizes in functions not working

I'm adding theme support for editor-font-sizes in my functions.php but it doesn’t take affect. Any ideas why? I’ve already added a custom color palette without issue, but having issues with this: ...
0
votes
0answers
14 views

What do the args for Gutenberg subpackage “hooks” function “doAction” mean?

The package is supposed to mime WP's own actions system: https://github.com/WordPress/gutenberg/tree/master/packages/hooks I've installed it locally and loaded up all of its modules, unfortunately, ...
0
votes
0answers
16 views

Overriding HTML/CSS Classes of “Columns” block from Gutenberg editor

A custom CSS framework such as Bootstrap or UIKit includes its own much more flexible grid system. I would like to use this instead of Wordpress's CSS for the default Column block. To override the ...
0
votes
1answer
32 views

WordPress v5.0.3 Gutenberg & JS error “Uncaught SyntaxError: missing ) after argument list”

After update from WP 5.0.2 to 5.0.3 I had issues in wp-admin. I couldn't edit post data. There was JS error "Uncaught SyntaxError: missing ) after argument list", undefined "_" (lodash) etc.
0
votes
0answers
15 views

Using applyFormat (from @wordpress/rich-text) to make persistent changes to Gutenberg's rich text value

I am working on a Gutenberg sidebar plugin which does some text analysis and based on that, it needs to annotate text in the paragraph blocks. This is the easier part and is achieved using the ...
1
vote
0answers
14 views

add action only if gallery shortcode attribute is equal to?

I'm customizing the gallery shortcode. Now, when the user clicks on edit button as shown below: We can see the gallery modal like below: In the right sidebar, we can see the gallery settings. And I ...
4
votes
1answer
43 views

gutenberg dynamic block is returning 404

I am trying to create a dynamic block and I followed the steps described in the documentation, but for some reason the content that is being returned from /wp-json/wp/v2/block-renderer/plugin-blocks/...
1
vote
2answers
27 views

get_post_gallery with Gutenberg

I have a site where I created a page that takes the gallery images from a post and puts them into a slider. I used the following code: // gets the gallery info $gallery = get_post_gallery( $post-&...
0
votes
1answer
24 views

Plugin echos text from shortcode function in gutenberg page editor

I'm creating a plugin to load custom posts by custom taxonomy (restaurant menu plugin).. I'm calling the main function (holds everything) by the add_action hook on 'init' and inside it I have another ...
1
vote
1answer
229 views

Allow excerpt for pages in Gutenberg?

I'd like to utilize excerpt field on pages. How do I enable it? Currently excerpt block only shows on posts in sidebar. But on pages it’s missing.
0
votes
0answers
21 views

create-guten-block in wordpress theme?

I'm working on a wordpress theme and want to replace my shortcodes with gutenberg blocks. I'm new to working with blocks but having looked into it a bit I've decided to try and use create-guten-block ...
1
vote
1answer
25 views

Gutenberg Filtering Metaboxes by Post Format

In the classic editor, it was quite easy to show and hide metaboxes according to post format, using jQuery: if( ! $("input#post-format-gallery").is(':checked') ){ $( "#gallery-metabox" ).hide(...
-1
votes
1answer
49 views

The editor has encountered an unexpected error. // TypeError: Cannot read property 'prefix' of null

when I tried to edit a post of a custom post type, I experienced this error. When I press "Copy Error" I am getting this: TypeError: Cannot read property 'prefix' of null at https://example.com/...
1
vote
1answer
11 views

Getting the selected terms for custom taxonomies in the editor

After reading this answer here, I can get the currently selected/checked terms for categories using this code: wp.data.select("core/editor").getCurrentPostAttribute("categories") However, this doesn'...
1
vote
0answers
19 views

Is there a way to create a block template that is not limited to a post type?

So, I have been reading up on block templates and from what I understand, they limit the ability to create them to one per post type. I just need to be able to add groupings of blocks without having ...
0
votes
0answers
14 views

Custom action button in Gutenberg editor (post_submitbox_misc_actions - equivalent)

On Classic Editor and Wordress 4.x i used 'post_submitbox_misc_actions' action to add custom control to submit box area. Is there a way to do this in Gutenberg editor? Some equivalent to old action? ...
1
vote
2answers
31 views

Getting a custom Gutenberg component's state from outside that component

I've registered a sidebar component in the block editor. I'd like to access the state of the component (MyPlugin) from outside of that component, in some arbitrary JavaScript in the same file. Is it ...
1
vote
1answer
18 views

Gutenberg “Add Block” button is not active (greyed out), cannot add new blocks

I am currently using Wordpress version 5.0.2, i want to add news posts but the button "ADD BLOCK" is not active.
1
vote
1answer
45 views

Removing Default Gutenberg Blocks, But Keeping Reusable Block Functionality?

I have been follow a tutorial here: https://rudrastyh.com/gutenberg/remove-default-blocks.html Where it discusses how to remove default Gutenberg blocks like so: add_filter( 'allowed_block_types', '...
0
votes
1answer
30 views

Gutenberg RangeControl

I'm trying to use the RangeControl component. This is what I'm doing: el( RangeControl, { label: 'Columns', value: props.attributes.my_attribute, initialPosition: 1, ...
0
votes
0answers
25 views

Gutenberg pass properties to filter

I'm using Gutenberg block filters to add a class name to the block’s wrapper component in the editor. registerBlockType( name, { title: __( 'My Block' ), parent: [ 'myplugin/myblock' ], ...
2
votes
1answer
118 views

Gutenberg gallery hook errors

I try to modify the gallery block of Gutenberg and I use the following snippet export function defaultColumnsNumber( attributes ) { console.log(attributes.images.length) return Math.min( 3, ...
2
votes
0answers
54 views

Modify the core/paragraph block

I'm trying to extend the core/paragraph block to add additional settings to the Gutenberg Inspector(?) (the right side panel settings) but I'm running into issues with it not yet being registered. I'm ...
0
votes
1answer
26 views

Shortcode to Gutenberg-block: additional text on front-end and conditional display

I'm working to translate a custom shortcode to a Gutenberg-block but am stuck on two issues. This post first treats the current situation, the next heading shows the problems I'm running into in ...
0
votes
0answers
27 views

Custom meta POST request fired twice when updating a post in Gutenberg

I have made a feature similar in behaviour to Revision Notes, but for Gutenberg. It is a Gutenberg sidebar plugin which adds a text field where users can write an edit summary when they edit a post, ...
2
votes
1answer
50 views

Gutenberg extend core blocks

How do I modify a core block, in my case gallery block to add extra markup to can fire some lightbox on created gallery. Is there a way to hook in on render of gallery on frontpage to adjust markup?
0
votes
0answers
44 views

How to get featured image in Gutenberg from a transition_post_status hook?

Before the WordPress 5.0 update, I was able to get the featured image URL from a transition_post_status hook, for posts that are just published, from the WordPress post editor (but not from Gutenberg)....
1
vote
1answer
33 views

Gutenberg passing block attributes to component in ES6/ESNext

I saw many examples on how to pass props from a block component to another component but they all use ES5 syntax. In ES6 the edit function when registering a block looks like this: edit( { ...
1
vote
1answer
27 views

Gutenberg withInstanceId. When to use it?

The WordPress block API for Gutenberg has a withInstanceId package. They say, Some components need to generate a unique id for each instance. This could serve as suffixes to element ID's for ...
0
votes
0answers
17 views

How do I add a Gutenberg editor to a custom options page

Can I add a Gutenberg editor to a custom options page (admin submenu page)? How? I'd like to create a editor for a 404-page, but I'd prefer not to use a standard page for it since our clients might ...
1
vote
1answer
17 views

How to edit the slug/permalink in Gutenberg?

After updating to WordPress 5 and creating a new post, I can add a title, but how do I edit the slug or permalink?
1
vote
2answers
27 views

Adding content in Gutenberg editor

I updated my site to the latest version of Wordpress. I started using the new editor but have a question. Is there a way to add a block of content that holds all the header tags and paragraph tags? ...
1
vote
1answer
22 views

How to make a custom taxonomy selectable in post publish area?

I registered a new taxonomy: function all_about() { register_taxonomy( 'all_about', array('post'), /* if you change the name of register_post_type( 'custom_type', then you have to change ...
2
votes
1answer
26 views

How to get with Javascript, how many categories or tags are selected in GutenBerg?

I was still unable to find out that in Gutenberg. Specifically, i used: wp.data.select("core/editor").getPostEdits(); to find out how many categories were checked. But it missed already checked ...
1
vote
1answer
18 views

How do I prevent the link from using url of the image in Block Editor?

I am working on a plugin for a client and am coming across an interesting issue after saving and reloading the page. Since I have had a hard time finding any actual documentation, I have been ...
0
votes
0answers
53 views

How to fix: “The editor has encountered an unexpected error”?

I have disabled all plugins and I'm still getting this error. It is preventing users from creating a post. The error is: The editor has encountered an unexpected error. What is the fix for this?
0
votes
0answers
25 views

How to make repeated component/block in Gutenberg

I want to create a custom Gutenberg block with these features below A parent container with repeated child component. The repeated component can be added/removed(if existed before) as many times the ...
0
votes
0answers
45 views

Gutenberg extending the existing class

I am building a prism plugin to highlight the code syntaxes. In existing code block there is already a sidebar option with Additional Class Name but i have to manually enter the class name for the ...
2
votes
1answer
36 views

Access GutenBerg data with Javascript?

I am trying to find out where does Gutenberg save changes/settings/options and how to access them? in Javascript object, variable or HTML-DOM? for example, whenever we choose category checkboxes, ...
0
votes
0answers
19 views

How to add a block to a category page?

I've got my wordpress site set up to show various menu pages that will feature the content of a category page. I'm curious, is there any way to add a block to the category page? I have a filter that ...
2
votes
1answer
48 views

Wordpress Gutenberg blocks: Input fields are not editable

Describe the bug In WordPress 5.0.2 with Gutenberg in the core (not the plugin), when using input fields to capture text from the user and providing a value= from props.attributes, the input fields ...
1
vote
0answers
99 views

How do you replace content generated by custom fields with custom blocks in Block Editor?

I am wanting to support the new Block Editor for a theme that I made for a client. However, one of the page types has part of the theme that is displayed depending on whether custom fields are set ...
1
vote
1answer
74 views

Enable Gutenberg on custom post type

I have this custom post type: function create_posttype() { register_post_type( 'companies', array( 'labels' => array( 'name' => __( 'شرکتهای عضو' ), 'singular_name' =...