Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

How to display save error to user in blocks editor

$
0
0

Replies: 0

I’m developing a plugin that could generate an error in the editor when a user saves or updates a post and I would like to test for and handle this scenario.

I have tried using wp_die() to force an error in an action hook for pre_post_update in order to test, but the Block Editor UI always shows “Post updated” and wp.data.select('core/editor').didPostSaveRequestFail() is always false regardless of the response to the update ajax request.

What am I missing? What is the UI looking for when determining if an update failed?


Viewing all articles
Browse latest Browse all 59525

Trending Articles