WordPress.org

Ready to get started?Download WordPress

Forums

Interrupting 'save_post' (2 posts)

  1. caddoo
    Member
    Posted 3 years ago #

    I have created a custom post type in wordpress with custom meta fields.

    These have all be done with the wordpress php functions.

    I need validation on these custom meta fields and I am currently using this messy method:

    http://bit.ly/gTwTyf

    I understand I might have to stick with this method.

    But what I need to know is how could I prevent the post from saving if the meta fields dont meet requirements.

  2. molnarm
    Member
    Posted 3 years ago #

    Interrupting post saving might not be a good way because all content would be lost. (Imagine typing a long post then losing it all because of a little error in a meta field...). If the meta value is wrong, don't save it or even better, use a default value.

Topic Closed

This topic has been closed to new replies.

About this Topic