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
1
vote
0answers
8 views

Placing a custom Control element in an existing block InspectorControls panel

I would like to place my existing custom control element into the core/heading component found here. I currently have my component in the Advanced Controls panel Illustration
0
votes
1answer
22 views

How do I check if I can use the allowed_block_types filter?

For a WordPress theme I deregister a few blocks for Gutenberg (in fact, I only register the ones I need). For this, I use a filter: add_filter( 'allowed_block_types', 'amb_allowed_block_types' ); ...
1
vote
0answers
18 views

Fetch post block/field data as JSON with Wordpress API

Usually find what I need from here without asking but seem to have run into something new, apologies if this has been answered elsewhere. I am building a site in wordpress which isn't my usual CMS but ...
0
votes
1answer
15 views

Why is wordpress suddenly stripping away all newline characters and how to disable this?

I've spent about 3 hours trying out various functions to figure out why the newline characters are being removed every time I save. How do I figure out why is wordpress suddenly stripping away newline ...
0
votes
0answers
15 views

Multiple Select on Gutenberg Sidebar as metakey

I want to show a multiple select element in the sidebar when editing a page in admin, where I can save the selected values in a metakey. Of course also load the selected values upon load of page-edit ...
3
votes
1answer
46 views

Gutenberg block get categories in SelectControl

I'm creating a block. I want my block to be able to output posts that can be "filtered". It should be possible to choose from which category the posts should be displayed. I have gotten so ...
0
votes
0answers
15 views

Docker Plugin Development

I'm trying to do some Wordpress plugin development including Gutenberg blocks by completely containerising things so I'm not polluting my host system. Ideally this one mean... Hosting Wordpress in a ...
0
votes
1answer
19 views

Categories in Gutenberg

I would like to have a multi select field for my categories. How can i do that? My code doesn't work: function getCategories () { var options = []; var categories = wp.data.select('...
1
vote
0answers
17 views

Register multiple styles / scripts in register_block_type

I use following code to register my Gutenberg Block: register_block_type('create-block/myblock', array( 'editor_script' => 'create-block-myblock-script-editor', 'script' => 'create-block-...
1
vote
0answers
22 views

Gutenberg block - Save PHP function's output as HTML?

I am new to creating blocks in the editor but have practiced with a couple tuts. I have been able to create a block that is able to use ServerSideRender, but after reading am I correct to think it is ...
1
vote
0answers
14 views

Inline Styles on all native blocks

Is it possible to apply inline styles to all blocks via filters? Or do only some blocks support it? basically I want to add the ability of adding a background image to a single column. So I added an ...
3
votes
0answers
46 views

Add additional classes to gutenberg .editor-styles-wrapper

I'm working with tailwind and I was wondering how you would add a class to the div that has .editor-styles-wrapper applied to it so it would be .editor-styles-wrapper .my-custom-class Is there a ...
0
votes
2answers
20 views

adding fade on mouseover to images

I'm a teacher and I have been using blogger for years, but a couple of days ago, I decided to switch to WP and opted for premium plan. I'm not a designer, but am able to do basic things (adding ...
1
vote
1answer
45 views

Redirect to “All Posts” after post update or publish in Block Editor

When anyone presses Publish or Update from the Block Editor in a CPT, I would like them to be redirected to the CPT listing page. (Users are typically editing many of the CPT at once, so this will ...
1
vote
1answer
36 views

How do you approach block structured content?

I'm currently trying to learn how to create a custom wordpress themes and while the documentation is pretty great there seems to be a lot ways to implement things on your website. What I'm struggling ...
0
votes
0answers
10 views

Block settings with InnerBlocks and InspectorControls does not show up in settings pane

I am trying to build a block element for my plugin. I want it to have block settings showing up on the right side (under the "block" tab). I am creating an InspectorControls element and ...
0
votes
1answer
19 views

Is there an easy way to remove the data-preserver-spaces span from blocks?

I converted a page from Classic to Guttenberg and now all the blocks have this span in them: <p><span data-preserver-spaces="true">...</span></p> This means that all ...
0
votes
1answer
32 views

Changing block quote size in gutenberg

Hello I have tried to change the size of the blockquote in Gutenberg editor by switching to HTML and changing the text font. But it doesn't work. I still have gigantic size block quotes that take up ...
1
vote
0answers
16 views

All post types with getEntityRecords

As the title states https://developer.wordpress.org/block-editor/data/data-core/#getEntityRecords doesn't allow an array of post types or any sort of delimited types. WP_Query normally accepts 'any' ...
0
votes
0answers
15 views

How to automatically remove noreferrer from targetd link rel attribute, on render?

gutenberg adds rel="noreferrer noopener" on every targeted link/button. I'd like to let noopener but to delete noreferrer. I know I can do it manually from the block panel. I also know of ...
3
votes
0answers
25 views

WordPress Rest API only returns content when posttype has editor capability

I am trying to request my post via the WordPress V2 Rest API in the backend. For whatever reason the post content is only returned when my custom post type has the editor support enabled. Is there a ...
1
vote
1answer
26 views

How to grab posts in Gutenberg Block?

Trying to get latest 10 posts to display in a Gutenberg plugin, but I can't figure out how to access the latest posts from the block.js. I know how to do it from PHP and it's easy, but this is new to ...
0
votes
1answer
35 views

Building a Featured Gallery component for Gutenberg

I'm building a Featured Gallery component for Gutenberg. As a guide, I'm using the existing Featured Image component from Gutenberg. Basically, instead of storing a single image id, the component ...
0
votes
0answers
17 views

How can I create more advanced layouts in Gutenberg block editor?

I'm looking to create a layout like the below, which is enabled by the Stackable plugin. I know exactly how I would do this if I was using CSS Grid, but because I want this to be easily drag-and-...
1
vote
0answers
19 views

How to link the whole list item in Gutenberg's latest posts block?

I am using a Gutenberg's 'Latest Posts' block on my front page. Featured image display and grid layout are enabled in the block settings. By default, only the post title is linked to the actual post. ...
0
votes
0answers
23 views

How to access parent block's attributes in nested block's save function?

I currently have a block that passes some of its attributes down to the nested InnerBlocks using React's Context API (the version of WordPress that I'm on does not yet have the Block Context feature. ...
1
vote
1answer
56 views

Gutenberg get withState variable in save function

I'm not very familiar with React and Redux. I have a problem with Gutenberg to get the value of the withState variable within the save function. Here's my code: edit( {attributes, setAttributes, ...
0
votes
0answers
9 views

Gutenberg Not Working with Trailing Slash Redirect in .htaccess File

I have updated my .htaccess file with non-trailing slash to trailing slash redirect. <IfModule mod_rewrite.c> RewriteCond %{REQUEST_URI} /+[^\.]+$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,...
0
votes
0answers
9 views

Syntax Highlighter Plugin with Hide Output Toggle

I am looking for WordPress syntax highlighting plugin that also supports hide-output-toggle like Real Python and Scikit-Learn Docs (look at code block that have a toggle to hide prompts and outputs). ...
1
vote
1answer
31 views

How to get the parent of a non-hierarchical custom post type being edited in Gutenberg

It's a common practice to use the post_parent property in the WP_Post class to create 1-to-n relationships between different custom post types. In an plugin I'm developing, I added a SelectControl to ...
0
votes
0answers
38 views

Save the post parent in a custom post type in Gutenberg

A plugin I'm developing registers two custom post types: Class and Student. Both are connected via the post_parent property in the Student post type (one student belongs to one class). I added a ...
0
votes
0answers
15 views

Is it possible to edit a wordpress category with Gutenberg?

i woud like to use Gutenberg to create custom category layouts. Is that possible somehow to activate it for categories?
0
votes
0answers
14 views

Filter by language in gutenberg posts block (polylang)

I use polylang and have posts in two languages. I created a page with a posts block using the gutenberg editor but the block shows me posts in all languages, only allowing me to filter by category. Is ...
1
vote
0answers
66 views

Add button gutenberg help

Hello I need to add a button to the toolbar gutenberg I found this https://developer.wordpress.org/block-editor/tutorials/format-api/2-toolbar-button/ but I do not get what is wrong for the button to ...
0
votes
1answer
21 views

How to view all currently registered block patterns?

I've registered a block pattern in my custom theme (using register_block_pattern) and it's not displaying in the block patterns list so I'm trying to debug whether I registered it properly. How could ...
0
votes
0answers
9 views

How to make two common blocks in Gutenburg?

I'm trying to make two custom of blocks in Gutenburg. But for some reason, it is working only the first block. I'm not sure if this is correct. Here is my code : Block at line 20-25 is working but ...
0
votes
0answers
13 views

Rich text (gutenberg) block not updating meta field

I want to save some HTML to my meta data using the rich text component. If the key does not exist, the rich text will create and save the key and value no issues. It will save edits as required; no ...
0
votes
1answer
13 views

Add a hyperlink to a group block?

I have a group of blocks that each contain hyperlinks to the same destination. Google Search Console reports a mobile usability problem "clickable elements too close together." To fix, I ...
0
votes
1answer
141 views

How to control an elements classes from multiple Gutenberg sidebar controls?

I am trying to extend the core/table block and copy-pasted, trail and errored me into something that is close to what I am trying to do. But I it's not quite working as I like. I like to extend the ...
0
votes
1answer
16 views

Where to find documentation for CPT block template? (PHP)

I have been searching for a day and still carn't seem to find the right documentation for what arguments I can pass to core components when attempting to configure a CPT block template in php. This is ...
1
vote
0answers
14 views

Hide Polylang metabox from the post edit sidebar

I need to have the ability to hide the Polylang metabox from the post edit page programmatically. I only want to show it to a few users, but hide it to people who do not have enough privileges. There ...
1
vote
0answers
26 views

How to get boolean value from register_meta properly?

I registered boolean by register_meta(), to use it in my Gutenberg Plugin Sidebar, I added default value to it true: register_meta( 'post', '_thefuturmeta_post_title_visibility', array( '...
1
vote
1answer
37 views

Two Gutenberg components sharing the same Panel Body in Inspector Controls

I've got a custom Gutenberg block that is using two custom components. Each of the components has a toggle in the Inspector Controls panel. This is just a simplified scenario, in reality, there will ...
1
vote
0answers
28 views

data-* attributes in blocks

If I edit a block html and add a data-* attribute to the element, the editor complains and says that "This block contains unexpected or invalid content.". for example, the perfectly valid ...
0
votes
0answers
17 views

How can I convert a metabox to components panel in block editor?

I added a custom side meta box to a custom post type in WordPress using addmetabox and I noticed that the UI is different from the default in the block editor. How can I make it resemble the default ...
0
votes
0answers
17 views

How to Stop Gutenberg From Adding Classic Block

I am using WPBakery for page layout and adding a Gutenberg Editor Block to type text. On saving the post, the Gutenberg Editor adds a gray classic box giving the post a lot more space between ...
1
vote
0answers
16 views

disable gutemberg welcome message

How to disable gutemberg welcome message that appears whenever the user creates an article or page for the first time / first connection ? Thanks
0
votes
1answer
25 views

Block Validation Fails: '<' in HTML content escaped by save function

I have some custom blocks. Each has a save function that gets content from the block's attributes: ( { className, attributes } ) => ( <div className = { className }>{ attributes.content }&...
0
votes
0answers
29 views

How to get the <RawHTML> to work in a custom Gutenberg plugin?

I am trying to develop a new Gutenberg plugin which will need to save raw html . I use the utility in the save method and it seems to be outputting nothing. Then I output the sampe attribute within ...
0
votes
1answer
26 views

large image size of 1440x1440 not pulling 2x of 2880x2880 image

I have updated the large image size to be 1440px by 1440px on Wordpress, however it only pulls 2048 for the 2x. I have created a 2x size of 2880x2880 and have also updated 2048 to be 2880x2880 however ...

1
2 3 4 5
17