Questions tagged [block-editor]
The Block Editor is the 'new publishing experience' introduced in WordPress 5.0, replacing TinyMCE and other aspects of the default editing experience. Find out more at https://wordpress.org/gutenberg/
1,980
questions
0
votes
0
answers
6
views
Align block editor
When working in the editor mode of Gutenberg blocks the editor field aligns fully to the left. So there is no space between text/images and the left side of the editor.
This changed from one day to ...
0
votes
0
answers
6
views
Custom `BlockControls` button for multiple block selection of different types
When selecting multiple blocks of the same type, BlockControls displays the custom bell icon button.
But when multiple blocks of different types are selected, it doesn't show:
Is there a way to ...
0
votes
0
answers
15
views
Disable interactivity for core navigation
I want to disable the default interactivity behavior from the core navigation block. I tried the following:
Load my block variation in the functions.php:
function da_custom_block_variations() {
...
0
votes
2
answers
22
views
How to auto rename JS files to prevent browser cache issues
Im creating a block plugin in worpress and each time I update my JS files, changes do not reflect to frontend because there's a browser cache.
I found some strategies in others frameworks that rename ...
0
votes
0
answers
15
views
Correct way of implementing complex navigation in Gutenberg
I am a bit lost in creating a block theme. I have read a lot about theme development and block development in the wordpress documentation and also at fullsiteediting and have some kind of ...
1
vote
0
answers
18
views
Can I integrate Gutenberg on one page only?
We have WooCommerce now which is specially developed and we use a custom design.
But we would like to use a page builder on the product page itself, so that we can set up, correct and add more easily.
...
0
votes
0
answers
22
views
Block validation failed for React Component block that rehydrates after taking effect
I have this specific block
than when I insert in the Editor, gives me this error:
and the error states:
Content generated by save function:
<div class="data-props" style="display:...
0
votes
0
answers
19
views
Get_Template_Part and Template files in TwentyTwentyFour Block Editor
I am building a project using WordPress 6.6.1. I have opted to create a child them which extends TwentyTwentyFour and therefore relies on the new block editor which is packaged in that parent theme.
...
0
votes
0
answers
19
views
Can't save/get Patterns' `post_content` attribute
I am currently successful at getting the WordPress patterns via the following query:
SELECT * FROM {$wpdb->posts} WHERE post_type = 'wp_block'
Problem is, I realized post_content is empty, except ...
0
votes
0
answers
19
views
Problem making a WPQuery with ACF boolean
Well after hours and hours I find myself finally here, I am building a gutenberg block that is getting a custom post type data and making little cards with it, it works very well if I want to get:
All ...
1
vote
1
answer
33
views
PHP Fatal error: Cannot redeclare distance() when making a new block
I created a ACF block. It calculates the distance from the displayed ski resort to the 3 closest ski resorts and displays a summary and is meant to use in a side bar or something.
I have a function ...
0
votes
2
answers
43
views
Full Site Editing, Block Theme, Gutenberg, Site Editor
With all the different names and ways to edit a WordPress site I'm a bit lost as how to future proof my theme.
Let me explain a bit...
First off, I use WordPress professionally at my job, I use it as ...
1
vote
1
answer
14
views
Preset category checkbox from URL parameter when creating new post
I have added custom "New Post" links to the admin menus and dashboard widgets in the admin panel to allow administrators/editors to post new content with the category preset when the editor ...
0
votes
2
answers
26
views
How to "comment out" a block in Wordpress (make it invisible without deleting it)?
Is it possible to "comment out" a block in wordpress when using the block editor?
I'm working on a wordpress site, and I want to temporarily make some of the wordpress blocks invisible to ...
1
vote
1
answer
26
views
How do I completely disable block editor?
I am trying to completely disable block editing and revert the entire site to the "classic editor version". I have already tried the disable gutenberg plug in, and the classic editor plug in,...
0
votes
1
answer
27
views
How to add "double footer" in Wordpress block editor? [closed]
How can I add two footers on-top of one another in Wordpress?
I'm trying to use the block editor to change the footer of my wordpress website. What I want is to have two footers that take-up the full ...
0
votes
0
answers
12
views
"Update" button missing from block editor
The update button is missing from the editor page("Spectra"). I do not have any elements selected and yet the "Save" button does not change to "Update" button.
0
votes
0
answers
23
views
How do I apply different block supports to different parts of my custom block?
I am developing a custom block for my WordPress plugin. The block is meant to be very similar to the WordPress core search block. On the default search block, there are several supports declared, ...
0
votes
0
answers
21
views
My home page is intermittently scrambled - any ideas?
I have created a Wordpress site using the block editor and Spectra One theme. It's all working fine but form time to time the home page is scrambled:
Scrambled page:
What it's supposed to look like:
...
0
votes
0
answers
11
views
Creating patterns with BlockArt
WP Dashboard crashes each time I try to create a pattern using a blockart element.
I have a basic blockart element: Section with a Heading & Paragraph. When I click “create pattern” it says “...
0
votes
0
answers
31
views
Problem creating a two level list that is text only (not links)
Using the Gutenberg editor, I am trying to create a 2 level list using the list block. I want this list to behave as text-only bullet points, not as links. Each entry of the top level works fine, but ...
2
votes
0
answers
23
views
Using @wordpress/scripts 28.x with WordPress <6.5
I am currently looking for a way to use the current @wordpress/scripts 28.x in a plugin with WordPress 6.5 or older. According to the tip here, you should deliver the jsx-runtime via webpack, but ...
0
votes
0
answers
15
views
Wordpress block based payment gateway showing - Getting Uncaught SyntaxError: Unexpected token '<' when printing html through js [duplicate]
I am updating existing payment gateway to support latest version of wordpress and also to make compitable with block-based checkout. I want to display multiple payment option list under my payment ...
0
votes
1
answer
45
views
How to display only the first 2 words of a post title
I am learning WP and want to display only the first two words of a post title to the user. For the end user only the first two words of the Post title (H1 class) should be shown but source should have ...
0
votes
1
answer
37
views
Getting Uncaught SyntaxError: Unexpected token '<' when creating block based custom payment gateway [closed]
I am updating existing payment gateway to support latest version of wordpress and also to make compitable with block-based checkout. I want to display multiple payment option list under my payment ...
0
votes
0
answers
40
views
Block Theme : Query Loop with attachments
I am new to wordpress development. These day I am trying to create my own block theme in wordpress. In my theme, I have added two file upload fields to default wordpress posts using ACF pluign. It is ...
0
votes
1
answer
32
views
How can I obtain an option (get_option) inside a block viewScript?
If I traditionally enqueue a script...
wp_enqueue_script('some-script', $dependencies_script_path, array( 'wp-i18n' ), false, $load_in_footer);
I can use wp_add_inline_script to send info from ...
2
votes
0
answers
124
views
Browser Crashes with WordPress Plugin SimpleTOC After Update to 6.6.x in reusable block
I am the creator of the SimpleTOC plugin for WordPress (SimpleTOC Plugin). After updating to WordPress 6.6.x (including 6.6.1), my plugin causes the browser to crash and freeze whenever the block is ...
0
votes
0
answers
22
views
Restrict Block from having a Parent or Ancenstor Block
I have a "custom/section" block with a template of "allowedBlocks" innerblocks eg. { children }.
But have been unable to restrict the "custom/section" block from having a ...
0
votes
0
answers
15
views
Add custom block to submenu variation
I've created a custom block, and with it, a block variation of the core sub-menu block that allows the custom block to be added to it. I can get the custom block to show up initially in the sub-menu ...
0
votes
0
answers
23
views
Gutenberg Dev - React Context.Provider returns undefined
I have a Context.Provider with a value setup in slider/edit.js.
When I import it in the child component slide/edit.js with useContext it returns undefined
I don't see what I'm missing here
For context ...
0
votes
0
answers
16
views
Customise "Add a New Post" page
I have a very simple question to which I am sure there is a simple answer, but after hours of searching I still can't find it.
I am a professional programmer who has been developing themes and plugins ...
0
votes
0
answers
47
views
Wordpress 6.6.1 - Trying to make a block but receive error, "! Cannot read property 'then' of undefined"
I am following this post. In the very first command I get an err
npx @wordpress/create-block@latest todo-list
npm ERR! Cannot read property 'then' of undefined
npm ERR! A complete log of this run ...
0
votes
0
answers
41
views
Style priority in theme.json
I have the following theme.json file in a custom classic/hybrid theme:
theme.json file:
"styles": {
"elements": {
"heading": {
"color": {...
0
votes
1
answer
35
views
Avoid automatic scroll jump when dragging a resize handle in a Gutenberg block
I'm building a scrollable horizontal gallery block (Please, spare me the comments about scrollable horizontal galleries being bad from a UI perspective). The gallery may have a text at the start or at ...
0
votes
2
answers
59
views
FSE Change Post Template to Something Other Than a List
I'm currently building a hybrid theme and am having trouble with my post template. It keeps rendering as an unordered list when what I want is a div structure. Is there any way to change it so that ...
0
votes
1
answer
21
views
How to use useSelect to retrieve the currently default fontFamily?
I'm trying to identify where I could find this information but I've not been able til the present moment, to achieve it.
I've been looking in core/block-editor and core/editor. I've been researching ...
1
vote
0
answers
26
views
Extend WordPress Gutenberg core/navigation-link
Hey folks So Im pretty new to this react + php in wordpress and I found one article where it showed how to extend a core block, which works fine for group and some basic block but When i tried to ...
1
vote
1
answer
59
views
No aspect ratio selector in a custom block
I added the aspectRatio prop to the block.json file in a custom block that renders a grid of posts of a specific type:
{
"$schema": "https://schemas.wp.org/trunk/block.json",
...
1
vote
1
answer
177
views
Add custom data attribute to every core Gutenberg Blocks
I'm adding two custom attributes to core Gutenberg blocks, data-delay and data-duration.
I want to add these attributes to manage animations blocks on my custom theme.
I wrote this JS code into block-...
1
vote
1
answer
24
views
Adding new Template Parts in the Block Editor when using Classic Themes
I am looking for a way for users (who will be site admins) to design Blocks that will be used by a plugin I am developing. I want the solution to work in both Classic and Block themes, so I have been ...
0
votes
0
answers
32
views
How do I highlight a Wordpress Menu Item for a page that is not on the Menu?
I am writing a Wordpress site using the block editor (Spectra One theme).
I have a menu item called News. When I click on it the News page appears and the News menu item is highlighted.
The News page ...
1
vote
0
answers
33
views
Block style variations not enqueued for blocks inside HTML code dynamically rendered via JS
The new WP 6.6 will let anyone style any registered block style variations in theme.json via the styles.blocks.blockName.variations property. Check the following post for more info:
https://developer....
0
votes
1
answer
119
views
How to Programmatically Trigger the Update of a Post in WordPress?
I'm working on a WordPress project where I need to programmatically trigger the update of a post in the backend. The goal is to have WordPress process and update custom fields as if I had clicked the &...
0
votes
0
answers
18
views
How can I remove the wp_autop filter from a shortcode block in a block theme page template (twenty twenty-three)?
I am using a custom page template in the "twenty twenty-three" theme. I am using a shortcode block as part of the template. This results in the shortcode not running within "the_content&...
0
votes
1
answer
215
views
Extending the Query Loop block
For client I need to create a simple 3x4 article grid that needs to have ads on fixed places instead of articles
X .. X .. Y
Y .. X .. X
X .. X .. X
X .. Y .. X
in example above Y is ad, and X is ...
0
votes
0
answers
9
views
Event when Modal is opened/visible
In my WordPress plugin, a Modal gets opened from within the Block Editor when a button is clicked.
const MyContent = () => {
const [isOpen, setOpen] = useState(false);
const openModal = () =...
0
votes
0
answers
37
views
list all gutenberg blocks properties with icon name as well
function custom_blocks_api_get_blocks()
{
$blocks = WP_Block_Type_Registry::get_instance()->get_all_registered();
$block_data = array_map(function ($block) {
return [
'...
0
votes
1
answer
35
views
editPost without undo entry
I am updating my post status with following snippet:
dispatch("core/editor").editPost( {
status: 'draft'
} );
My problem is, that this action creates a new undo-entry. Is it possible ...
0
votes
1
answer
27
views
Building my first ever Gutenberg block
I have created a Gutenberg block using the following command:
npx @wordpress/create-block test-block --template @wordpress/create-block-tutorial-template
Reference: https://developer.wordpress.org/...