Set Post Status by Field Value

Currently, the post status of a post generated from a Gravity Form submission is set via the Post Title, Post Body or Post Excerpt fields. So what do you do if you want the post status to be based on some form of user input? It’s a form-specific option (as opposed to field specific) which means Gravity Forms’ powerful conditional logic can not help us here.

Fortunately, the solution is quite simple. Put on your pointy wizard hats and check out this snippet.

Comments

Would it be possible to create three separate Gravity forms with the same function?

I wrote the same snippet three times on function.php, and replaced the form ID (gform_post_data_n) and field ID ($entry[n]) in each to correspond to the respective Gravity form. A refresh on the website returns a blank white page.