Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Possible Duplicate:
Prevent post from being published if custom fields not filled
Check before publishing, if already exist post with current custom field value

I am trying to add some metaboxes to post edit page. They contain essential data for my template so I have to make sure they are filled and valid.

Validating them is not a problem. Before saving data I check them. But what to do when they are incorrect? I would like to stop saving process and print some nice error message but I have not found any reasonable way to do that. The post shall not be saved without these forms validly filled.

Thanks for help.

share|improve this question

marked as duplicate by Stephen Harris, toscho Jul 9 '12 at 21:34

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
See also: wordpress.stackexchange.com/a/42178/9364. The above link refers to checking if meta data already exists in another post, and this if the mete data is 'invalid' - but the principle is the same. –  Stephen Harris Jun 10 '12 at 15:07
    
Thanks for the links, they are really helpful. Trying to solve it. –  Rusty Horse Jun 10 '12 at 16:07