Unanswered Questions
1,534 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 ...
6
votes
0
answers
248
views
Customize WordPress Media Manager - Media Window
Im trying to customize the wordpress media manager "add media" window to get it as simple as possible to use. So i want to disable/ hide the following fields/ functions because i dont need some or ...
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
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
91
views
my function doesn't return my post from today
I'm using gravity form to create some custom post type - as events.
Everything is working great, There is some date field to setup the event from x to y date. ALl of this working great.
However, I ...
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(
'...