540 questions
0
votes
0
answers
13
views
Wordpress Plugin - Implements Blocksy Pattern inside a Block Editor Plugin
I'm working on a new plugin on Wordpress, using the Block Editor model.
My intent is to take the "custom taxonomies" and propose them in a loop structure. What I can't reach to do is use a ...
1
vote
1
answer
43
views
How change the default value of the heading block in Gutenberg
The default heading is H2, but I don´t have this options, I only have H3 in dropdown
How change the default value of heading, for example change to H3?
I removed the headings from the Gutenberg editor ...
1
vote
1
answer
40
views
Post title ignoring context and patterns not working with provided postId and postType context in render
I've setup a basic block that needs to pass down the context of a post to its innerBlocks similar to how the query block does, so that the title, featured image and excerpt blocks work off that new ...
1
vote
1
answer
25
views
packaging block.json renderTemplate in basic webpack setup using @wordpress scripts
On a Wordpress install, I am using ACF Blocks with “block.json”, where my blocks are compiled from a /source directory to a /build directory, where they are registered via register_block_type. I’m ...
1
vote
1
answer
86
views
Adding ACF Block Using block.json - Displaying The Preview Hover Image
ACF support have asked that I render my blocks their preffered way... adding this;
function register_acf_blocks() {
register_block_type(__DIR__ . '/blocks/primary-thin-banner');
}
add_action('init'...
1
vote
0
answers
36
views
Preventing Webpack Build Process from Deleting Optimized Images in Custom Gutenberg Blocks Plugin
I'm developing a custom Gutenberg blocks plugin and have integrated an image optimization process into my workflow. I'm using sharp in a custom Node.js script to generate optimized WebP versions of ...
0
votes
1
answer
72
views
Gutenberg Custom Block Styles Are Loaded After Footer Causing FOUC and CLS
I'm facing an issue with my custom Gutenberg block plugin, and I could really use your expertise.
I am developing a plugin that registers multiple blocks. All of them are dynamic blocks that use ...
-1
votes
1
answer
60
views
How to detect errors in the WooCommerce checkout form added with the checkout block?
I have a WooCommerce store that uses a checkout block. I want to track with Google Analytics what WooCommerce checkout fields are empty or are incorrectly filled in. The check should happen after a ...
0
votes
0
answers
50
views
Wordpress 6.6 Gutenberg "paste" event propagation from inner WYSIWYG editor
I have a custom Gutenberg plugin which adds a custom block with React Quill editor in said block. Before 6.6 version if I pasted content in Quill editor things would work as expected - content will be ...
1
vote
0
answers
72
views
Gutenberg Block variation - how to change the label and instructions
I've registered a block variation of the core/file, and in the JS code I can change the title/description/icon etc. But I can't see how to change the default text ('Upload a file or pick one from your ...
2
votes
1
answer
161
views
How to set default alignment for core/buttons block to center in Gutenberg block development?
I'm developing a custom Gutenberg block where I am using the core/buttons block inside my custom block template. I want the buttons to be aligned to the center by default when the block is rendered, ...
0
votes
1
answer
69
views
Change gutenberg block editor mode from edit to preview and back programmatically
I only want one block to be in edit mode at a time.
In a loop over all blocks (wp.data.select('core/block-editor').getBlocks()) I try to set all blocks, except the currently selected (wp.data.select('...
0
votes
1
answer
69
views
InnerBlock not saving in self made custom plugin
I'm kinda new to WP development. I'm trying to build my own plugin that has custom block types for me to use. I've set it up that the js file of each custom blog has the html and styling for the ...
0
votes
0
answers
56
views
Filter the items inside of Gutenberg mediaUpload for a certain custom block
I want to use the core media picker inside of a block. For the block im working on I need to only return images that contain "xyz-".
I can get my desired results GLOBALLY with the hook "...
1
vote
0
answers
84
views
Custom block registered within custom category in WordPress is not showing in admin end
I am developing a custom theme in which I am trying to include some custom blocks by registering a custom block category. But it is not showing in the admin end.
Though when I execute the command it ...
0
votes
1
answer
107
views
Customizing useBlockProps
I'm making a custom block to insert video. I've added some styling options with the BorderControl component.
Options selected with the component are applied by default to the block in the editor ...
0
votes
0
answers
22
views
Gutenberg BorderControl component CSS
I'm using the BorderControl component:
import {__experimentalBorderControl as BorderControl} from '@wordpress/components';
<BorderControl
colors={colors}
label={__('Border', 'sage')}
...
1
vote
0
answers
21
views
Test wp.data with Jest in Block Plugin
I am trying to get my head around testing my Wordpress Block Plugin with Jest. I am specifically struggling how to mock calls to wp.data.
See the following function:
import apiFetch from '@wordpress/...
0
votes
0
answers
117
views
Custom button in the block editor inserter button ("Add block" button)
How can I list/log all JS hooks (actions/filters) in gutenberg editor?
Basically I want to understand if the .block-editor-inserter container has any actions or hooks (@wordpress/hooks) to make ...
2
votes
0
answers
149
views
Remove gutenberg block supports
I'm fairly new to Gutenberg. I want a means by which blocks can be inserted within a group, but the user has no means of modifying the group attributes, other than the background colour.
I'm ...
2
votes
1
answer
155
views
WordPress Gutenberg Block Validation Failed: Attribute Mismatch on Re-edit
I'm developing a custom Gutenberg block for WordPress using the @wordpress/create-block package. The block allows users to add a testimonial with an image, name, position, and testimonial text. The ...
0
votes
1
answer
190
views
Need help in fixing/debugging wordpress to know why my block is not visible in my theme's block editor
I am new to WordPress development but have decent experience with Javascript.
So I've tried out this tutorial on Udemy (https://www.udemy.com/course/become-a-wordpress-developer-php-javascript/) and ...
2
votes
0
answers
149
views
How to add multiple custom blocks in custom Wordpress theme using create-block?
I want to add multiple custom blocks to my custom wordpress theme using create-block package.
In my root folder I initiated package.json by running npm init -y and added wp-scripts as a dev dependency....
0
votes
0
answers
72
views
Display text and variables above WooCommerce cart block, and in cart items components
I am trying to display "Hello World $some_php_variable_related_to_cart" above the WooCommerce cart block (in a proper way, using WordPress and WooCommerce API), and to update $...
0
votes
0
answers
15
views
Accessing Attributes in nested InnerBlocks [Wordpress - Metabox]
I try to send one value from two nested innerBlocks. The blocks are written in php and build with Meta-box.
$insertUrl is retrieve dynamically from php in the bloc parent. I try to send it to the '...
0
votes
0
answers
56
views
Jetpack Gutenberg Slideshow Block Not Working or Rendering on Custom AJAX Infinite Load Posts
I'm encountering an issue with the Jetpack Gutenberg Slideshow Block in WordPress.
When I use a custom AJAX function to implement infinite scrolling and load more posts dynamically, the Slideshow ...
0
votes
0
answers
94
views
How to cache an apiFetch method for a Gutenberg block?
I store WooCommerce product IDs in a custom block:
<!-- wp:custom/block {"woo_products":[123,456]} /-->
I need to call the /wc/v3/products endpoint to retrieve the data from this ...
0
votes
0
answers
201
views
Modify cart item subtotal format in the WooCommerce cart block
In the cart shortcode, I use the woocommerce_cart_item_subtotal hook to display the item subtotal using wc_format_sale_price(), because I'm showing a deal.
Here is the code:
$subtotal = \...
1
vote
0
answers
939
views
How to customize Woocommerce Cart or Checkout Blocks HTML templates?
I am developing a WordPress theme using the WooCommerce plugin. For a specific role, I want the "Proceed to checkout" button on cart block to be replaced with a custom button with a custom ...
1
vote
0
answers
104
views
How do you change a wordpress theme body colour in the theme.json file?
From what I've understood, Wordpress is encouraging using the theme.json file to style up a theme rather than using css files to target specific classes. I've figured out how to style buttons and ...
0
votes
0
answers
43
views
Wordpress nested block variation
I have two blocks parent and child. I would like to create variation of both of them (parentV and childV) and have the childV as inner block of the parentV. But when I try it with ...
1
vote
1
answer
532
views
Wordpress Gutenberg Custom Block the viewScript does not get loaded on the frontend when my block is inserted
I recently developed a custom Gutenberg block by utilizing the @wordpress/create-block package, which effectively generated a full plugin framework. I simply needed to tweak some existing files to get ...
0
votes
1
answer
80
views
WooCommerce, Gutenberg, ACF Blocks - problem with html characters in duplicated product
I've had a problem for some time and I can't find a solution.
Woocommerce, I have enabled Gutenberg support for products. I have ACF blocks that work and look correctly, but when I try to duplicate a ...
0
votes
1
answer
502
views
Woocommerce blocks: Update custom field values based on shipping country
I'm trying to make WP WooCommerce new block-based Checkout page a parcel terminal selection when a specific shipping method is selected.
Example
But I need the select field options to be given ...
1
vote
1
answer
266
views
Woocommerce blocks: Show custom field based of selected shipping method
Maybe someone can help with showing a custom field depending on the selected shipping method in the new block-based WP WooCommerce Checkout page?
Do I have to add something in the block.js file or do ...
2
votes
1
answer
130
views
Support for gradient colors in Gutenberg richText inline highlight option
I want to add the support for the gradient colors in highlight option against any selected text. For reference please see this comment.
I have seen this stackOverflow thread as well. It provides ...
0
votes
1
answer
199
views
Show wordpress Gutenberg-editor blocks in DOM
The Gutenberg-Editor of wordpress works with blocks that are marked by HTML comments, i.e. <!-- wp:heading --><h2>My Heading block</h2><!-- /wp:heading -->.
I can inject such a ...
0
votes
1
answer
250
views
How can be written wp.element.createElement('img' into a registerBlockType?
I am looking for a solution to this question about WordPress Blocks.
I have a plugin that create a brand new block of an img tag.
I would know how to display it in the wp.blocks.registerBlockType ...
0
votes
0
answers
63
views
Remove/disable HTML ELEMENT dropdown selector from Gutenberg block editor
I am struggling to disable/remove the HTML ELEMENT dropdown selector from the WordPress Gutenberg block editor from the group/row block from the advance tab.
Is it even possible to remove this ...
0
votes
0
answers
403
views
woocommerce cart-view page broken after clicking in edit with elemtor
I am working in Wordpress on a website and I am using Woocommerce.
Good to know, I had disabled the Gutenberg editor and I am working in the classic editor.
I have a question regarding the woocommerce ...
0
votes
0
answers
1k
views
Custom Payments method compatible with WooCommerce Checkout Blocks
I have been working on creating a payment method in WooCommerce that should work on the new block system, but for some reason, when editing the checkout page, I can see the payment method, but when I ...
0
votes
0
answers
109
views
Can't locate block template
I have a bit of a weird issue where my Blocks templates can't be located when loaded into the website.
I'm using the Timberland theme (https://github.com/cearls/timberland) which leverages Timber &...
2
votes
0
answers
1k
views
WooCommerce Payment Method doesn't show in Checkout Payment Block
I recently created a plugin for customized payment platforms on WooCommerce, it seems to work in the back-end and I can activate this custom payment gateway from the settings, but it doesn't seem to ...
0
votes
1
answer
83
views
React component that groups posts and displays them in sets of 2 or 3, alternating between the two configurations
I'm building a Gutenberg block that that groups posts and displays them in sets of 2 or 3, alternating between the two configurations. This is the code I came up (some code omitted for brevity):
const ...
0
votes
1
answer
412
views
How to use :hover in Gutenberg custom blocks?
So I have a problem with building block that has background-color attribute and the user can change it using ColorPalette component.
When creating a custom block in gutenberg we need 2 functions ...
1
vote
0
answers
71
views
React compile failing for Wordpress Gutenberg block
I've started with
npx @wordpress/create-block@latest my-block --variant=dynamic
which goes as far as "installing @wordpress/scripts package" and then fails with SIGKILL and no action on my ...
0
votes
0
answers
305
views
How to add additional fee for specific payment method on checkout page with Woocommerce Gutenberg block?
When the checkout page is generated by 'woocommerce_checkout' shortcode, we can use 'woocommerce_cart_calculate_fees' hook to add an additional fee for any specific payment method with this js code to ...
0
votes
0
answers
254
views
Use block content to get post ID in WP_Query loop
I have made a plugin to save Testimonials. For this:
I have a custom post type called Testimonials, under which Testimonials are saved.
I have a custom block, which the user can put anywhere in the ...
0
votes
2
answers
494
views
Wordpress Gutenberg : What is the "Block Name" setting in the inspector
Does anyone know the purpose of the "Block Name" parameter in the Gutenberg Inspector? I don't understand what it's for, it's not saved in the database and I can't find any documentation ...
1
vote
1
answer
433
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 ...