The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Interrupting 'save_post' (2 posts)

  1. caddoo
    Posted 5 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:


    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
    Posted 5 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