Display Error Message When Block Editor Term Validation Fails
-
?? Hi,
I am validating data for a custom taxonomy term with the
pre_insert_term
https://core.trac.www.ads-software.com/browser/tags/5.9/src/wp-includes/taxonomy.php#L2353 filter. When the user adds a term that fails the validation, I want to notify the user when they are using the Gutenberg block editor (modal,alert()
, etc).Does WordPress automagically do this if I set a specific
status
value with the instance ofWP_Error
returned bypre_insert_term
?I tried
400
and500
and that didn’t do it.I’ve looked through the docs and source code for a client-side hook to evaluate the response of POST to
/wp-json/wp/v2/{TAXONOMY}
but unfortunately I have not found any leads.Is there a hook that exists?
Otherwise, how would I accomplish this?
Thanks for any help!
- The topic ‘Display Error Message When Block Editor Term Validation Fails’ is closed to new replies.