Load script after block is inserted

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() in React JS/Gutenberg?

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

WordPress problem with htmlentities

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!