Additional CSS classes not being added in Gutenberg editor
Additional CSS classes not being added in Gutenberg editor
Additional CSS classes not being added in Gutenberg editor
Why is my JS not working on initial load?
add_attachment hook not firing on certain devices
The wp_kses() call looks to me unneccessary as you’re already escaping the values within the foreach loop. esc_js() should be just fine as the strings are mostly hard-coded and the only part that is changing is the date value, so escape that. If value is always 1, then escaping it doesn’t add any real value. … Read more
Is there an existing method to store a large set of states (900+ flags/numbers) for a single form page that it can persist for several days?
How do I expose the current logged in users name/etc to javascript?
When developing a block with @wordpress/scripts, wp-scripts uses @wordpress/dependency-extraction-webpack-plugin to allow you to import dependencies from WordPress by replacing the import statements with references to the global variables loaded by the enqueued scripts. For example, this: import { useEffect } from ‘@wordpress/element’ Will become: const { useEffect } = wp.element; And wp-element will be added … Read more
You are already using the correct action, i.e. wp.data.dispatch( ‘core/editor’ ).editPost(), however, you should instead change the property named template. I.e. wp.data.dispatch( ‘core/editor’ ).editPost( { template: ‘article.php’ } ) Yes, _wp_page_template is the meta key in the database, but in the REST API, a property named template exists in place of direct access on that … Read more
Your code isn’t at fault. The Masonry library doesn’t support this cross frame scenario. I can think of three ways you might get past this: Inject the masonry script into the iframe so it could be used from within the iframe Patch the masonry script and ship that version with your plugin Find an alternative … Read more
It’s probably related to how you’re loading that JS file, which causes it to run before the element is available (despite domReady). You didn’t show how you’re loading the file etc, but your code works for me in a standard Gutenberg block edit.js: export default function Edit() { domReady( function () { const postTitleWrapper = … Read more