Showing errors in the WordPress Block Editor
As part of updating this blog’s custom theme to something from this decade, I had to make all of my custom plugins work with the Block Editor (i.e., Gutenberg). One key difference between the Classic Editor and the Block Editor is that the former does a full-page refresh after each save.
To display errors in the Classic Editor, you simply store a message as a transient and pop it off in the admin_notices hook:
“Surely, it’ll be similarly easy for the Block Editor,” I thought. Oh how naïve I was.
WordPress decided that the Block Editor should live in some utopian world where everything is a block. That’s all fine and dandy if you ignore that WordPress has existed for… Continue reading →Showing errors in the WordPress Block Editor