Save as draft custom behavior

This topic contains 3 reply and 2 voices, and was last updated by Tareq Hasan 10 years, 5 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
November 26, 2013 at 5:39 am 12840
Tareq Hasan Hello WPUF Team! Thank you guys for a really really awesome plugin! I am trying to use the Save draft function but having a bit of blockage over here, please help! This is what i'm trying to accomplish: 1. User(while logged in) goes to the Add Post form and completes one of the following steps: a) Fills in all required fields and hits "Add Post/Publish" button: -> Post gets updated to status "Pending" + We get email notice + User is redirected to Thank you page. b) Fills only half of the required fields and hits "Save Draft" button. Then leaves the Add Post page. Comes back later to complete the form and has options to "Add Post/Publish" or "Save draft". If chooses Add/Publish, same thing happens as in case a)! If user chooses to Save Draft again, well then any additional info will be saved for later publishing. Currently when clicking Save Draft to come back and complete the form later i get options to "Update" or "Save Draft". For my case it's important that the user is redirected to thank you page + post gets status "pending" + I get notification e-mail. How do I customize the code so that when a post is in draft mode it has options to "Add Post/Publish" and "Save Draft". Thanks! Simo
November 26, 2013 at 3:06 pm 12863
Tareq Hasan Tareq Hasan

When they are in the same page and clicks save as draft, they are still in the “Create New Post” page and the submit button says “Add Post/Publish”.

But when the come back later to update a post, they are in the “Edit” post scenario. If you want to change the submit button text to “Add Post/Publish”, you can do that by editing the form and “Edit Settings” tab. Also in your case, the edit post status should be pending.

November 27, 2013 at 3:30 am 12903
Simo Simo

I don’t think this can be solved simply by changing post edit button text and edit form settings.

Let me try to explain more clearly:

Basically i need a workaround for “Edit” post scenario which recognizes if post is currently saved as “draft” or not. If it is, then instead regular “update” button we display new button with “submit_text” and submit functionality fires redirection + new post notification + updates post status to “pending”.

When post is anything else than “draft”, the button and submit functionality must remain original cuz if eventually a post gets confirmed and updated to “published” status by the admin, user can still go and edit the post without any change in post status(using “No Change”). Then it’s simply like renewing info and also saving as draft button is no more necessary.

Hope this explanation is better and we can work out a solution!

Please help me with code example or give guidelines which part of code to change and how.

Appreciate it!

November 28, 2013 at 12:19 am 12933
Tareq Hasan Tareq Hasan

In the current state, the plugin can’t recognise if the post was saved in status “draft” by pressing the “save as draft” button or by submitting the form. When you are coming back again to edit the post, it’s in EDIT state and it’ll follow the edit post settings.

I get it what you want. But sorry, the plugin doesn’t work as the way you are thinking.

Viewing 3 Posts - 1 through 3 (of 3 total)