Unanswered Questions
1,427 questions with no answers
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 ...
5
votes
0
answers
883
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....
4
votes
0
answers
1k
views
Developing the save function in Gutenberg blocks
I am editing the save function on my local wordpress instance. Every time I make a change, I need to manually click the "Attempt Block Recovery" button to see the updated change when I go to ...
4
votes
0
answers
536
views
Custom Block - save.js function not saving attributes
I'm trying to get just a basic custom block displaying in the editor and saving. I've followed multiple tutorials and I keep getting the same result. No matter how simple my block is, whenever I add a ...
4
votes
0
answers
321
views
Provide specific example for block variation
I'm generating block variations on top of the "native" Gutenberg blocks (eg. core/***).
For example, I have a "catchphrase" block, which is a variation of the paragraph block (core/...
4
votes
0
answers
76
views
Using Primary Color in Plugin Block
I'm developing a Gutenberg block, and I want the block to fit in as nicely as possible with the users site. So I'm trying to include as little styling of my own as possible, eg. allowing buttons to ...
4
votes
0
answers
280
views
Gutenberg Blocks - Attributes from comment delimiter or from HTML?
I wrote a custom block and am trying to better understand the interplay of the JavaScript and PHP on both front and back end regarding blocks.
Say I have some block that I want rendered dynamically. ...
4
votes
0
answers
205
views
Hooking a callback into the code within a Gutenberg block
I want to run some JavaScript when a user uploads an image or images using the core/image block or core/gallery block. Ideally I would run my own code when the onSelectImage function is called (and ...
4
votes
0
answers
609
views
How to reload a select box of posts dynamically?
I'm using custom meta boxes for a project. I have created a custom taxonomy (select box) and I have another select box populated with Posts. I need to only load the posts based on the selection of the ...
3
votes
0
answers
110
views
What is "open()" in MediaUpload?
Googling (or searching here) on "open" is hard :)
The readme for MediaUpload gives this example:
<MediaUpload
onSelect={ ( media ) => console.log( 'selected ' + ...
3
votes
0
answers
650
views
WASM page in Wordpress website
I used emscripten to generate some html/js/wasm/data files and would like to add that as a page to my (Wordpress) website. Is this possible? If so, how?
3
votes
0
answers
55
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 ...
3
votes
0
answers
386
views
WordPress Customizer Control with React
I am just doing a demo on the WordPress customizer API to edit the header with custom controls.
I have designed a custom control by extending WP_Customize_Control and Jquery to refresh/postMessage ...
3
votes
0
answers
118
views
How can I filter block registration based on post-type? (Block alignment settings)
I want to disable the .alignwide and .alignfull block alignment options (remove them from the editor UI) on the 'post' post-type only.
I have tried using this block registration filter to modify the '...