Skip to main content

Unanswered Questions

852 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
535 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
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 ...
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 '...
3 votes
0 answers
246 views

How to save a ToggleControl value in a meta field?

I registered a boolean meta field called _meta_restrict in a custom post type: PHP: function register_meta_fields() { register_post_meta( 'custom_post_type', '_meta_restrict', array( '...
3 votes
0 answers
397 views

When using the block.getSaveElement hook can you output different markup based on whether or not you are in the edit view or the live page view?

I am trying to extend the core/image block to add an option for a deferred image. I want to replace the src attribute of the image with an empty string and add the url as a data attribute to be loaded ...
3 votes
0 answers
1k views

Is it possible to intercept all ajax requests and get the parameters and the returns?

Is there any hook that always goes through it, where I can see all the requests, and also the returns after the "action" that is executed? I need to intercept all requests, including requests from ...

15 30 50 per page
1
2 3 4 5
57