Quick tutorial explaining two ways to set the Post Status of submitted posts.
Global Post Status
To set the default/global Post Status for all forms, visit USP General settings > Auto Publish Posts and select an option from the dropdown menu. This option will be used for all forms unless a local/per-form Post Status is defined.
Local Post Status
To override the default Post Status for any USP Form:
- On the Edit Form screen, scroll down to the Custom Fields panel
- There, define a new custom field named
- Give the custom field a value corresponding to the desired Post Status
Note: the custom field that we are using for this technique should look like this:
That is, the custom field used here is a regular custom field, not a field that will be included in the form itself (compare with custom fields that will be included in forms).
Here is a list of acceptable values for the
usp-post-status custom field:
- -6 – Future (scheduled)1
- -5 – Password2
- -4 – Private
- -3 – Custom (uses value of General > Custom Post Status)3
- -2 – Pending
- -1 – Draft
- 0 – Publish
- 1-20 – Auto-approve after number of posts
1 Note about “Future” Post Status: in order for scheduled posts to work properly, you must specify a Custom Post Date. Otherwise, if your form sets a Future Post Status but does not specify a Post Date, the Post Status will revert to Publish and the submitted post will be published immediately.
2 Note about “Password” Post Status: an email that contains the post password will be sent to the email specified via the Email field. Or, if the Email field is not included on the form, the post password will be sent to the address specified under USP Pro settings > Admin > “Admin Email From”. Note also that you can customize the email address, subject, message, and headers via their respective USP Pro hooks.
3 Note that USP does not automatically register your specified Custom Post Status. So any Custom Post Status defined via the setting, General > Custom Post Status, must already be defined via your theme or some other plugin.
See also: Custom Post Dates.