Quasy – modal component does not hide itself

The problem is that you’re using setIsOpen() incorrectly. Your code initialises isOpen as false, and your code implies that it can be either true or false, but that’s not what you’re setting it as. The setIsOpen() function updates isOpen to the value you pass to it, and you’re passing an object with an isOpen property, … Read more

How to extend SelectControl with data from my theme

You can use wp_localize_script() to pass JavaScript variables to the editor: $asset_file = include(get_template_directory() . ‘/path/to/blocks/index.asset.php’); wp_register_script( ‘pb-theme-blocks’, get_template_directory_uri() . ‘/path/to/blocks/index.js’, $asset_file[‘dependencies’], $asset_file[‘version’] ); wp_localize_script( ‘pb-theme-blocks’, ‘pbThemeBlocksVars’, array( ‘classes’ => array(), // Your theme classes go here ) ); Then in your edit function: const classes = pbThemeBlocksVars.classes;

Gutenberg InnerBlocks allowed types and reusable blocks

Yes, “why you can’t insert a reusable block inside your custom block when you’ve used alllowedBlocks?” This is what I am trying to get This is because you haven’t allowed them: allowedBlocks={[‘example/children’]} The list of allowed blocks does not include reusable blocks ( core/block ), so they are not allowed and cannot be inserted. Add … Read more

Getting incorrect filepath inside custom block front-end output using @wordpress/create-block tutorial

WordPress is inlining the style as an optimisation: When a page gets rendered, stylesheets that have opted-in to get inlined get added to an array. Their size is retrieved using a filesize call (which is why the path data is necessary), and the array is then ordered by ascending size (smaller to larger stylesheet). We … Read more