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

Gutenberg Gallery Block - Change the Order of Images

I am trying to figure out if it is possible to sort the images in the default Gutenberg Gallery block by title or by date ascending (from oldest to newest)? I could not find any information in the ...
0
votes
0answers
7 views

Is it possible to bulk migrate all deprecated instances of a gutenberg block?

I wrote a plugin which defines a gutenberg block. After using this block in posts, I've changed its definition inside my plugin, so now I have a "deprecated" entry in the block configuration ...
1
vote
1answer
11 views

Custom taxonomy is crashing Gutenberg

I have a custom taxonomy, "Type" and I have it registered to my custom post type "Resource." But if I enable "show_in_rest" I get a JS error: TypeError: Cannot read property 'transientEdits' of ...
0
votes
0answers
9 views

Add “Embed” Media type to Media Library

I'm looking for an alternative to the standard embedding work flow. I need all my embedded attachments to have the same meta data fields as uploaded content (description, caption, title, etc). The ...
0
votes
1answer
13 views

how can default_content filter tell if content will load in block editor or classic editor?

In short, I want to use the default_content filter to return slightly different content depending on if it will be used in the block editor or not (eg. the quicktags or tinymce editor) - is there any ...
1
vote
1answer
26 views

Can Gutenberg be used as an editor on a page?

I have a few dozen WordPress sites using the Classic Editor. When an Editor/Author/User logs in, they cannot access "wp-admin". All "admin" functions use custom pages on the front end of the site. ...
0
votes
0answers
17 views

Empty posts return an HTML comment

I'm using the script from this answer to exclude empty posts from the main query. It work well, but since the new WordPress editor, some empty posts return a comment rather than an empty string. i....
1
vote
0answers
12 views

Remove WordPress/Gutenberg button styles for ACF blocks

Is there a way to remove the default styling of the gutenberg editor? I am building a custom theme using ACF blocks, part of one of the blocks has a button that is being displayed from the template ...
0
votes
0answers
25 views

How can I include custom Gutenberg Blocks in a theme?

I know that officially Wordpress wants people to include blocks as companion plugins, and I understand their reasoning for that. I am building a theme with a very specific usecase though and I would ...
0
votes
0answers
17 views

Is the return value of wp_oembed_get() a valid block?

In the answer to "How does WP detect format type (and can I make use of this)?" a method is given for detecting block type. If I passed in the result of, say, $out = wp_oembed_get($href); would that ...
1
vote
1answer
16 views

Display different gutenberg template from selected post attributes

According to https://developer.wordpress.org/block-editor/developers/block-api/block-templates/, I have managed to add a template to the custom post type with the following code - /** * Portfolio ...
0
votes
0answers
21 views

page.php template file render a core gutenberg component programmatically

Is it possible to render a Gutenberg component programmatically directly in page.php template file? I don't have specific requirements and I am newbie as well in Wordpress with Gutenberg. But I was ...
2
votes
0answers
26 views

Gutenberg Reusable Block as part of WordPress Theme page

I'm using WordPress "Twenty Nineteen" (child) theme. What I'm trying to achieve is to include one of my previously created Gutenberg Reusable Blocks as part of theme's index.php file. The reason for ...
1
vote
0answers
17 views

How can I access core/paragraph textColor in a block template

I am trying to set the default textColor of an Innerblocks => paragraph in my Gutenberg block plugin. The problem seems to be that placeholder is an attribute but textColor is passed as a prop https:...
0
votes
0answers
11 views

Is there a way to change block namespace without breaking the block?

Is there any way to change block namespace without breaking the block, example i just want to change block namespace from bb-gutenberg/box to better-gutenberg/box. something like deprecated block ...
0
votes
0answers
17 views

How to make a script load after Custom Block is loaded in the editor?

I'm trying to make a Custom Gutenberg Block, but I'm having trouble with loading javascript that goes with this block. On the front-end it works fine, but in the editor it seems that the script ...
0
votes
0answers
9 views

How to insert links while working with Yoast FAQ block in Gutenberg?

I'm writing a FAQ using Yoast's FAQ plugin that creates FAQ block in Gutenberg editor. Everything runs smoothly but I can't add links or any other formatting elements to answers. Is there an option ...
0
votes
1answer
14 views

Wordpress custom block compatability with WPML

I am trying to build a simple custom Wordpress block using the Block API, but I'm struggling to get the text strings to show up for translation properly within the WPML translation plugin. I've seen ...
0
votes
1answer
17 views

Filter for author list in gutenberg core editor

Is there a filter to modify the presentation of certain editor editor components? For my example, I want to be able to filter the author list which is a select input in the Gutenberg editor on the ...
0
votes
0answers
14 views

Gutenberg Custom RegisterFormatType with PlainText in InspectorControl

Here is what I am trying to achieve. Register a new Format Type e.g. tooltip. Show the tooltip option in the toolbar. If a user adds a paragraph block and types a few words, by selecting a word we ...
0
votes
0answers
26 views

How to add custom editor with Gutenberg blocks?

Today I'm having a custom post type where I have a custom editor added like this: function add_meta_boxes() { add_action('edit_form_advanced', 'intro_editor'); } add_action('do_meta_boxes', '...
4
votes
1answer
49 views

How to get the ToggleControl Gutenberg component working for a PHP Block

I got everything working based on this: https://gist.github.com/pento/cf38fd73ce0f13fcf0f0ae7d6c4b685d its just that the toggle does not get the visual representation of being toggled on. Any ...
0
votes
1answer
16 views

File structure and react setup when creating multiple Gutenberg blocks

I'm having trouble understanding the build/compile setup and file structure when creating multiple blocks in Gutenberg. Both React and Gutenberg are new to me. But I've had a pretty good primer on ...
0
votes
1answer
18 views

Gutenberg component in a plugin admin

I would like to use Gutenberg components to develop my plugin admin but I faced some issues regarding some of components like ColorPalette. I tried to ask the question on Gutenberg repository but ...
0
votes
1answer
17 views

Some posts not displaying by taxonomy term

I've run into something very odd that I don't think I've ever seen before. I'm trying to query a custom-post-type and organize the results into groups by a custom taxonomy term. The post is Project ...
0
votes
1answer
25 views

How to get all the available post tags using the WP Data Module?

This is my first time working with wordpress, and right now I'm working with a legacy code, migrating some plugins to be gutenberg ready. There's a plugin that gets all the available tags in the ...
1
vote
0answers
25 views

How to register a embed handler as a fallback to a oEmbed handler?

Testing this with the Embed Gutenberg Block. In the backend it actually shows the video so this seems wrong that it behaves differently there. Registering embed handlers causes the to take priority ...
1
vote
1answer
25 views

Converting a theme to Gutenberg but some styles are missing in the front end [closed]

I have come accross a bit of a problem when converting a theme to gutenberg - I have done this plenty of times before and never come accross this issue. Having added the relevant theme support e.g. ...
0
votes
0answers
12 views

How can I change the post format when a particular category is selected?

It used to be really easy to do this. Just stick a little jQuery in admin_footer. But that doesn't work any more, thanks to Gutenberg. Here's the functionality I need to reproduce: add_action( '...
1
vote
1answer
19 views

Trying to create a mouseover effect in html using Gutenberg editor

I am trying to create a mouseover effect in html on a content block in the Wordpress code editor. I want an icon to change color on mouseover and change back on mouseout so I'm referencing two ...
3
votes
1answer
62 views

Gutenberg Range Control default from meta value

I'm trying to add a range control underneath the feature image component in the admin dashboard, and I need to access the value from the post, so am saving it in post meta. It's all working great, but ...
0
votes
0answers
21 views

Add custom taxonomy to editor's side menu

In my theme, I've registered a custom taxonomy and attached it to a custom post type: // functions.php function create_custom_post_type() { register_taxonomy( 'tags', '...
0
votes
1answer
34 views

How do I hide the UI for specific Gutenberg Blocks?

I have found a article about this filter but I am supposed to pass a array of allowed blocks to it. This is what I got so far that ddd is my debugging function from Kint Debugger it reveals that the $...
0
votes
1answer
24 views

How to disable Gutenberg editor from Multisite Admin panel?

I recently Updated WordPress to 5.2.2 and I want to disable Gutenberg editor from network. By this way, I do not need to go into each sites and disable one by one. I have already installed Disable ...
0
votes
2answers
167 views

Icons are missing from Visual Editor

The Problem I've been grappling with this bug over several days now to no luck. When editing either a post or a page, all icons in the Visual Editor are missing: As you can see this, includes the ...
1
vote
1answer
42 views

Choosing a default page tempate (Classic => Gutenberg)

This code was working in the "Classic" era to set a default page template: /* Blank Page by default */ add_action('add_meta_boxes', 'blank_default_page_template', 1); function ...
0
votes
1answer
20 views

Can't set custom meta fields for a post

I am trying to add some custom meta variables to a custom post type, but I can't see the new variables when I dump a posts meta data, and I can't access it in Here is the post definition from my ...
0
votes
0answers
37 views

Dynamic gutenberg block with react instead of php

i'm building a wordpress theme based on the wordpress rest api, So everything on the frontend is built with react. But I want to build a gutenberg custom block that displays the most popular posts. is ...
0
votes
0answers
12 views

Enqueueing ALL Gutenberg styles

So I wanted to build my first Gutenberg-ready WordPress theme. I found add_theme_support( 'wp-block-styles' ); and I thought it would help me with making the process more consistent (it's always ...
7
votes
0answers
146 views

How to filter or remove default panels in Gutenberg PrePublish Panel

I would like to edit the text or remove and re-create the Publish panel of Gutenberg's PrePublish Panel in the editor sidebar. I know I can use wp.data.dispatch( 'core/edit-post' ).removeEditorPanel( ...
0
votes
0answers
23 views

wp.blocks.registerBlockType not showing what I want on the frontend

According to my understanding, whatever is displayed in the save: function is what is shown on the page in the front end? So I am trying to query the database from my block to get information I am ...
2
votes
1answer
26 views

conditional layout based on if Innerblocks is not empty

This seems like a simple issue, but I can't seem to find an answer. I'm using InnerBlocks to stack some paragraphs in a wrapper. If there are no blocks set I'd like to not output the wrapper at all. ...
1
vote
1answer
55 views

Unable to override MediaPlaceholder component

I'm trying to override the MediaPlaceholder component from wp.blockEditor.MediaPlaceholder using the available filter editor.MediaPlaceholder. Below is my code snippet: // plugin.js import ...
1
vote
1answer
48 views

How can you reset InnerBlock content to base template?

I am looking for a method to re-render the <InnerBlock template... after I've updated some attributes. This is my sample code I am working with. Notice the onChange event is where I need my ...
3
votes
2answers
42 views

Block Editor: add an aria-label to an option inside a SelectControl

I'm building a block that has, among other things, a FontAwesome icon. I'm currently letting users choose which icon by using a WP <SelectControl>. For individual <option>s, there is a ...
2
votes
2answers
100 views

creating elements/innerblocks via rangecontrol

I'm attempting to put together a variable/mixed content carousel block. I'm having issues trying to figure out how to create/delete individual slides in the carousel (using something like rangecontrol)...
1
vote
1answer
32 views

Get loading state of wp data selector

I have a custom block that shows the assigned taxonomy terms for the current post. I'm trying to show a loading spinner while those terms are loading in the background. Let's say I have a selector ...
0
votes
0answers
31 views

How to get ACF value inside Gutenberg Block from another page or template? I'm using Timber too

I'm trying to display on my WORK page a value of a ACF field that lives inside a block in a custom post type project. If I get all posts using Timber function like this: $posts = Timber::get_posts('...
0
votes
2answers
42 views

Create Element From Dynamic HTML String [closed]

I'm working on a custom gutenberg block, and in the save method, I have dynamically changing HTML in the form of a string. element.createElement( 'div', null, contentString, ) The above ...
1
vote
1answer
19 views

Is there an official email form widget or block?

I want to add an email form to a wordpress site, but all of the existing ones I see are from third parties. Doesn't Wordpress offer an official email form to add as a widget or block?