I'm very glad that there is such a dedicated website for WP.
My problem is data validation upon saving attachment fields. I have added many custom fields to attachment/media library dialog, most of them are marked as mandatory. (Ex. $form_fields["some_custom_field"]["required"] = true;
) But this just adds the class, but no validation or checking is done on WP side, so I want to check them myself with functions attached to attachment_fields_to_save
filter. I can check and so on, BUT THE QUESTION IS:
How to validate these fields, so if validation do not pas - WP returns an error in it's regular style, just like in registration form if you fill bad email.
In registration process in register_post
action you can do this $errors->add('some_error_code', "<strong>Klaida</strong>: Nenurodėte įmonės kodo");
and it will not save data and return to visitor an error. I want that in saving attachment form :D