How to check if customize previewer is refreshing?
How to check if customize previewer is refreshing?
How to check if customize previewer is refreshing?
I ended up putting an empty svg in an img tag with an onload event. This is probably not ideal, but it does work. <img // onload hack fires when block is added className=”onload-hack-pp” height=”0″ width=”0″ onLoad={ onBlockLoad } src=”data:image/svg+xml,%3Csvg xmlns=”http://www.w3.org/2000/svg” viewBox=’0 0 1 1′ %3E%3Cpath d=”/%3E%3C/svg%3E” />
How to use wp.hooks.addAction? It’s basically like so, just like you’ve attempted: // Hook to the hook_name action. wp.hooks.addAction( ‘hook_name’, ‘namespace’, function(){ console.log( ‘Foo Bar’ ); } ); // Trigger the hook_name action. wp.hooks.doAction( ‘hook_name’ ); Or for hooks which provides one or more parameters to the callback: // Hook to the hook_name action. wp.hooks.addAction( … Read more
Block editor: How to check if block editor has initialized and populated the data store?
Set current tab on a Gutenberg TabPanel component from outside that component
How to handle Gutenberg wp.data async errors?
After banging my head against Gutenberg’s wall for a few hours, I came up with something that seems to work. It uses the useSelect and useEntityProp hooks instead of the withSelect and withDispatch HOCs. The truth is that using hooks makes the code simpler and easier to understand. /** * WordPress dependencies */ const { … Read more
Provide specific example for block variation
It seems that the “convert_chars” filter is causing the trouble, try removing it by: remove_filter( ‘the_content’, ‘convert_chars’ ); Also try removing the richedit_pre hook (which formats the text for the rich text editor, also uses convert_chars function) by: remove_filter( ‘the_editor_content’, ‘wp_richedit_pre’ ); Hope that helps!
The handle is media. View in source, line 403.