How to get the parent of a non-hierarchical custom post type being edited in Gutenberg
It’s a common practice to use the post_parent property in the WP_Post class to create 1-to-n relationships between different custom post types.
It’s a common practice to use the post_parent property in the WP_Post class to create 1-to-n relationships between different custom post types.
I’m building a Featured Gallery component for Gutenberg. As a guide, I’m using the existing Featured Image component from Gutenberg. Basically, instead of storing a single image id, the component stores an array of image ids in a dedicated meta field (of type array) called _featured_gallery.
Apparently, the getting and setting part is working, but I’m unable to show the grid of selected images (the featured-gallery-grid part in the code).
Any ideas? My knowledge of Gutenberg and React is limited, so I’m a bit lost here. Any help would be appreciated.
I’m trying to add a class to list blocks (core/list) in Gutenberg. Unfortunately, it looks like because some blocks like lists and paragraphs don’t have the standard default class name of wp-block-{name} they can’t be renamed using the blocks.getBlockDefaultClassName filter.
I’m trying to add an extra class name to all the blocks by extending them. Documentation: Extending Blocks
I have a site where I created a page that takes the gallery images from a post and puts them into a slider.
The introduction of the Block Editor killed all plugins which offered publishing conditions, such as minimum word counts, featured image requirements etc.
I am trying to extend the Gutenberg core/gallery block to add some new functionality to my image gallery on the frontend. I have created a separate plugin to handle this task.
I have registered my script with the following code:
I’m writing a function to allow only some custom blocks – essentially I want to register all the blocks, then based on a database table of ‘selected’ blocks disallow any other custom block.
Assuming I have no infinite scroll or anything else going on in my theme:
Is there a way to enqueue my custom Gutenberg block styles and scripts so they are only (lazy) loaded in the front-end when the block is really used? Something like is_active_widget, just for blocks?
I would like to display a dropdown list of categories (or other taxonomy) inside of a Gutenberg block. I can only think of two ways to do this: