Unanswered Questions
1,915 questions with no upvoted or accepted answers
19
votes
1
answer
2k
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( ...
8
votes
3
answers
1k
views
Pass media upload value to input field
I have created a meta-box that provides a upload function via the default media uploader from WordPress.
This works fine as long as I have one upload option.
But guess what? I want another one.
If I ...
7
votes
2
answers
1k
views
Implementing Gutenberg RichText onSplit / onReplace
I need an unordered list, but with options selected for each list item. To achieve this I've created a custom block called icon-list which is a ul element with InnerBlocks, which allows only my custom ...
6
votes
0
answers
611
views
How to remove unwanted panels inside InspectorControls from core blocks in Gutenberg
If I want to extend the core block I can use Block Filters where I found a filter like editor.BlockEdit.
Example from doc:
const { createHigherOrderComponent } = wp.compose;
const { Fragment } = wp....
6
votes
0
answers
2k
views
How to trigger JS in gutenberg page load
I've loaded a jQuery script with enqueue_block_editor_assets for gutenberg and wp_print_scripts for frontend which is loaded fine.
add_action( 'wp_print_scripts', 'sk_load_script' );
add_action( '...
6
votes
0
answers
1k
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 ...
6
votes
0
answers
521
views
Gutenberg Blocks doesn't render correctly when using do_blocks
I'm trying to render a post_content with blocks using the do_blocks function, that takes a gutenberg content, parses every block, and returns an HTML string.
The problem is that some blocks aren't ...
6
votes
1
answer
452
views
RequireJS in custom theme. Working Example
I try to add to my custom wordpress Theme requirejs because I do not want to use wp_enqueue over and over to inject used plugins and on the other side I do not want to mess the DOM from the beginning.
...
5
votes
1
answer
75
views
How to move the customizations done in the Editor to my child theme?
Dashboard -> Appearance -> Editor -> 3-dots menu -> Export lets one download a zip file, which contains the folders parts and templates that - according to various online tutorials - ...
5
votes
1
answer
2k
views
Adding a custom PanelColorSettings control to a core block, and using the color slug in a custom className
I'm trying to add a custom color control to the group and cover blocks, and if a color is selected, construct a custom className for the block. This custom class is used for a section separator.
What ...
5
votes
1
answer
2k
views
Once Again: How to Remove Option from Gutenberg Editor for Specific Block in theme.json
Since WP 5.8 we can define various settings in the theme.json which is much appreciated and really helpful. But there are still some options I cannot find, e.g. how can I remove the layout panel from ...
5
votes
0
answers
613
views
How to support Lazy Loading Assets in a WordPress Theme?
I'm using the create-block module provided in Gutenberg Core to build my custom blocks within a plugin. It works great, but I'm struggling to figure out how to conditionally load the assets on the ...
5
votes
0
answers
882
views
Is there a core Sortable component in Gutenberg?
I managed to somewhat replicate the product gallery metabox from WooCommerce in Gutenberg using the
third-party react-sortable-hoc component. As it seems that this component is no longer supported, I'...
5
votes
0
answers
1k
views
Remove left alignment option in core/image block
I’m trying this code to disable the left alignment option from the core/image block. I just want to make available the center and right alignment options.
wp.hooks.addFilter(
'blocks....
5
votes
0
answers
1k
views
How to use getBlockIndex
I want to create a block with HowTo microdata markup and automatically assign ID to child blocks. I have created a holder as the parent block, and I want to give the first child block id="step1", ...