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/

Filter by
Sorted by
Tagged with
0 votes
0 answers
17 views

Javascript function defined in view.js not reachable from save.js

I am trying to develop a custom gutenberg block. I have a form in save.js: export default function save() { return ( <div {...useBlockProps.save()}> <form onSubmit={...
Shugui's user avatar
  • 1
0 votes
0 answers
15 views

How to make query loop block dynamic

I am looking for a tutorial to figure out how to set the query loop block to get its category from the post it is in so I only set it in single post template not in every post I wanna create. Is that ...
Poorya Ghorbani's user avatar
0 votes
0 answers
6 views

Get FontSize from the InspectorControls Standard Control (typography.fontSize)

I have developed a block and am now trying to determine the size of the font based on the selected FontSize in order to be able to further use this value for calculations. The font size is selected ...
Jürgen's user avatar
0 votes
0 answers
19 views

Is it possible to pass dynamic data from a parent dynamic block to descendant dynamic block via context?

I know that in WordPress it is possible to create dynamic blocks in PHP which can, among other things, gather data from external APIs to collect data needed to render them. I also know it is possible ...
Eric's user avatar
  • 21
0 votes
0 answers
20 views

how to refrence woocommerce blocks in code?

i am writing a block that extends some core blocks, so when i refrence them i use the way wordpress refrence them: "core/group", "core/heading" and so on. and it works great. i ...
Ron's user avatar
  • 125
0 votes
0 answers
21 views

do_blocks not working with a custom block

i am trying to render one of my custom blocks inside a PHP file: <?php $block_content = do_blocks( ' <!-- wp:create-block/gb-button-block /-->' ); echo $block_content; ...
JPD's user avatar
  • 13
0 votes
0 answers
18 views

Custom Block: Adding "Post Type" dropdown to Sidebar Settings

I'm pretty new to React, so I'm trying to find the simplest and most PHP-based way to achieve my goal. What I've accomplished so far Created custom blocks using the @wordpress/create-block package. ...
beat's user avatar
  • 1
0 votes
1 answer
16 views

Category theme template becomes default template for child theme

I am developing a child theme and have created a custom template for "category/ archives" page for a specific category However, For some reason this custom template has become the default ...
Kendall's user avatar
  • 179
0 votes
1 answer
21 views

How to move custom gutenberg block controls from settings to styles tab?

I'm writing custom Gutenberg blocks for my future projects. I have a few blocks and everyone of these has its own controls that allow change of border attributes, colors etc. All of these controls are ...
Mateusz's user avatar
  • 153
0 votes
1 answer
15 views

New server, custom blocks all give "Your site doesn’t include support for the xxx block"

I'm trying to move a site to a new Ubuntu server, and enable HTTP2 in the process. This means I've had (I think) to switch to php-fpm. The only issue is with the custom blocks in the theme - anywhere ...
toby1kenobi's user avatar
0 votes
0 answers
6 views

Splide carousel block - innerBlocks not selectable after innerBlocks change

I've built a carousel block using the Splide library, which mostly works great. The options are reactive and that side of things works fine. However I have an issue when modifying innerBlocks (add/...
Brett Mason's user avatar
0 votes
0 answers
37 views

config @wordpress/scripts with webpack and postCSS features

I using wordpress as CMS and I want to config @wordpress/scripts with webpack and adding PostCSS and it's plugins like: postcss-loader, postcss-import, postcss-simple-vars,postcss-nested, postcss-...
Alipvd's user avatar
  • 3
0 votes
0 answers
31 views

Jest Unit tests for High order component containing Block Editor

everyone! I created High order component HOC which adds additional panel to Advanced section at the right sidebar Something like this: import React from 'react' import {InspectorAdvancedControls} ...
oshka's user avatar
  • 1
0 votes
1 answer
27 views

Implementing onSplit/onMerge in dynamic Gutenberg Custom Blocks

I’m working on a custom dynamic Gutenberg block. I’d like it to act like a normal rich text paragraph (e.g., can be split or merged as needed), rather than have multiple “paragraphs” included in one ...
bellbird22's user avatar
2 votes
0 answers
48 views

How to get Gutenberg pattern sync status for custom pattern listings table?

I am using classic WordPress (no FSE) but with Gutenberg. I have registered a submenu page for the post_type wp_block to get an admin interface for my Gutenberg patterns. Since WP 6.3 they merged ...
lepardman's user avatar
  • 183
1 vote
0 answers
19 views

How do I get my Gutenberg element to prevent last modified from updating?

I've added a checkbox on my Gutenberg post, that when checked, is supposed to prevent Gutenberg from updating the post's post_modified and post_modified_gmt columns. The checkbox manages its own state,...
John Doe's user avatar
  • 287
0 votes
0 answers
9 views

My Wordpress plugin don't show the button on Gutenberg

I create the follow plugin to fullfill this: "Create wordpress plugin that does the following: Has a button that shows up in the Gutenberg editor for a post, in the sidebar, often referred to as ...
Manuel's user avatar
  • 1
1 vote
1 answer
49 views

Gutenberg DatePicker component with time set to zero

I'm using the following code to get and set a date meta value for a CPT in Gutenberg (some code omitted for brevity): const [meta, setMeta] = useEntityProp( 'postType', 'activity', 'meta' )...
leemon's user avatar
  • 1,806
0 votes
1 answer
13 views

Why does have_posts() return false when in the wordpress admin, but not on the frontend?

Background: I'm new to the Gutenberg block editor and I'm trying to develop a custom block theme. I'm using ACF to create custom blocks. Problem: I'm creating custom blocks with the intention of ...
Danielle's user avatar
0 votes
0 answers
11 views

Set form inside <Placeholder> for new Gutenberg Block

I am looking for a way to get the same result as the Standard Gutenberg block "Table" for my new custom Gutenberg block. I want that inside the fields are seen as inside a form and that ...
Matteo Feduzi's user avatar
0 votes
1 answer
25 views

twentytwenty children theme, using gutenberg, changing a title change them all

I started to look forward modifying thèmes and i made a children theme from twentytwenty. On the landing page, using gutenberg, i edited page name at top, then added some paragraph, gallery and when ...
akalabete's user avatar
1 vote
0 answers
24 views

How to build BOTH non-block components and blocks present in the /src directory using @wordpress/scripts

I regularly use @wordpress/scripts for building both blocks and non-block components. Recently, I started working in a new plugin that registers both some blocks and non-block components that add ...
leemon's user avatar
  • 1,806
0 votes
0 answers
23 views

Translating Gutenberg Block - JSON Translation Files Not Loading

In following the steps outlined in this question I am unable to get it to work with the setup that I have. Essentially I have all my custom blocks within a structure like so: They are loaded in ...
Mike Badgley's user avatar
0 votes
0 answers
23 views

Separate typography controls for titles and meta in a custom block?

I'm building a simple dynamic custom block that shows a list of posts of a custom post type. JS: import metadata from './block.json'; import './style.scss'; const { name } = metadata; export const ...
leemon's user avatar
  • 1,806
0 votes
1 answer
39 views

what is the function of the view.js file?

i have made some blocks before with @wordpress/create-block now i wanted to work on a new block, and it seem there is a new file: view.js. i have searched the web and ducomentation in the handbook, ...
Ron's user avatar
  • 125
0 votes
0 answers
16 views

How to force Cover block to use the full size image resolution

Is there anyway to force Cover block to use the full size image resolution? It changes it based on the screen dimension and some times it gets so blurry which is awful! Should I write some lines of ...
Poorya Ghorbani's user avatar
0 votes
0 answers
31 views

Why does using different URLs in WordPress settings cause a "Publishing failed, you are offline" error?

In the WordPress General > Settings, when we update the WordPress address and the Site address to two different URLs We're not able to update/create posts. It is throwing an error saying "...
joshwinny's user avatar
1 vote
0 answers
12 views

Load RTL CSS using block.json for block development

I am developing a block using block.json and I could load RTL CSS on backend using this code: // Check if RTL mode is enabled if (wp.i18n.isRTL()) { // Import RTL stylesheet if RTL mode is enabled ...
Farhad Sakhaei's user avatar
1 vote
1 answer
301 views

Why is the Gutenberg editor not recognizing my updates?

I'm currently working on a Gutenberg block that includes a toggle control to hide or show content. I'm following the WordPress developer documentation, and the block behaves correctly when I toggle ...
JayDev95's user avatar
  • 169
0 votes
0 answers
25 views

Embedded data and the _fields parameter in getEntityRecords

I'm using the following code to retrieve a list of post of a custom post type named movie: const { posts, hasPostsResolved } = useSelect(select => { const query = { order: 'desc', ...
leemon's user avatar
  • 1,806
0 votes
0 answers
15 views

ACF block gutenberg aligncenter don't work

I'm starting with creating Gutenberg blocks with ACF. I would like to create a simple button, so far so good. My problem comes from the center alignment. When I align my element to the left and right ...
Thica's user avatar
  • 15
1 vote
0 answers
16 views

How to add Foreground Colour option to custom block

I'm trying to add a custom Foreground Colour setting to a custom block I'm building. I have Background Colour being added via Block Supports, and would like the Foreground Colour option to appear in ...
Infobahn's user avatar
0 votes
0 answers
13 views

Gutenberg inline style messing up the navigation when I add a list to a page

This is sort of weird. I have a set of pages and the navigation looks the same on all but one page. After trial/error I was able to narrow it down to having a list on my page. As soon as I add a list ...
J.P.'s user avatar
  • 1
0 votes
1 answer
31 views

How to create blocks from shortcodes?

I want to create a shortcode of myself that outputs “blocks”. Level 1: Setting a pure text I know how to do a simple shortcode. Let’s take this example. add_shortcode( 'greet', 'myNiceShortCode' ); ...
Xavi Montero's user avatar
2 votes
0 answers
41 views

How can I add classes to the Gutenberg iframe (editor-canvas) body tag? Added in WP 6.2(?)

I believe Gutenberg content was iframed in WP 6.2 if all blocks are v3. I have used a function like below to add very important custom classes to my admin body tags which in turn alters how the ...
lepardman's user avatar
  • 183
2 votes
1 answer
82 views

Set a default overlay color for the Core Cover block in theme.json

I would like to know if it is possible to set a default Overlay color for the Core Cover block using theme.json, so that when a new Cover block is added, that Overlay color is pre-set rather than ...
WebElaine's user avatar
  • 9,310
0 votes
0 answers
10 views

Are shortcodes now allowed in synced blocks?

I am totally, utterly, baffled. I have been going through the process of remaking reusable (synced) blocks as unsynced, and I suddenly became aware that my shortcodes in synced blocks, which earlier ...
bkepl's user avatar
  • 21
0 votes
0 answers
30 views

Editing a block to add a button to have a drop cap

Currently, I have a code to edit the paragraph block and add a button to convert it into having a drop cap. const { __ } = wp.i18n; const enableToolbarButtonOnBlocks = ["core/paragraph"]; ...
Omar's user avatar
  • 1
0 votes
0 answers
6 views

Add default meta data to a page/post template

Creating a Gutenberg template and populating it with default content is as simple as defining the initial content inside a file of the templates directory of a theme and the defining said template in ...
Walrus's user avatar
  • 131
2 votes
0 answers
54 views

Gutenberg move post/page title to Editor sidebar document panel

I have not liked the way that the post/page title in Wordpress 6 / Gutenberg is contained directly in the block editor. I have found many ways to remove it with filters and / or restyle it but ...
Walrus's user avatar
  • 131
0 votes
1 answer
169 views

Manipulating the allowed inner blocks of a core-gutenberg-block?

I had special requirements for a Button-Block for the Gutenberg-Editor, so I built a custom block "myproject/button". Now I try to use the core/buttons block with this new button block, but ...
FbnKlmn's user avatar
  • 13
0 votes
1 answer
33 views

ServerSideRender crashes block in editor

I have a custom block that uses a render function which works fine for the front end but the as soon as I add <ServerSideRender /> to the edit function of my block it just errors out with This ...
Arcath's user avatar
  • 239
2 votes
1 answer
61 views

Block Editor - Meta values not saved, meta changes to empty array on update

Issue TL;DR I have a block that updates meta values, but when I click 'update', the values are not saved for the post. Additionally, the meta values I get from useEntityProp load as an object with ...
Baerkins's user avatar
  • 163
0 votes
0 answers
63 views

WordPress Editor Missing Padding and Background Color?

For some reason, my editor has no left and right padding and I have no idea of how to get it back. It seems it has also lost its white background. I'm using Twenty Twenty-Three and I'm not sure at ...
Alvaro's user avatar
  • 121
0 votes
0 answers
48 views

Registering plugin's Gutenberg blocks in custom theme

I have a custom theme (developer no longer available). The theme uses Gutenberg. They way it's built is the Gutenberg put in a separate directory inside the theme. Now I have a plugin "Photo ...
amnotabot's user avatar
0 votes
0 answers
90 views

Zip using "wp-scripts plugin-zip" with custom "build" folder and subfolders?

I rename the default build folder to blocks, but when I execute the command for zip npm run plugin-zip I get only two files in the zip output (dts-haya.php, readme.txt). My folder blocks contain two ...
Giovanna Penna Eirada's user avatar
0 votes
1 answer
42 views

Create Youtube embed block with createBlock

I was trying to use this to create a Youtube video block using JavaScript: // Define the YouTube video URL (replace with your desired URL) const youtubeVideoURL = 'https://youtu.be/NNrj0N-yTnM'; // ...
Alvaro's user avatar
  • 121
0 votes
1 answer
28 views

Image size not showing up in 'wp/v2/media'

I'm trying to get the URL of a specific image size, and I'm using apiFetch: const response = await apiFetch({ path: `wp/v2/media/${id}`, method: "GET", }); The ...
Vincent's user avatar
0 votes
1 answer
61 views

Enqueue Stylesheet on the front end and in the block editor Conditionally

How would you include a stylesheet in both the block-editor and on the front-end if the page meets certain criteria? In this case I want to include a stylesheet called homepage.css if the page is the ...
Walrus's user avatar
  • 131
0 votes
1 answer
81 views

'403 Forbidden' when publishing a post containing different blocks

I'm experiencing a werid issue I never ran into before. I'm on WordPress 6.3.1 and each time I try to publish a post on my blog I get the "Updating failed. The response is not a valid JSON ...
Css14's user avatar
  • 13

1
2 3 4 5
38