[Résolu] Is there a CRED shortcode for changing a post status e.g. to "draft"
This support ticket is created Il y a 4 années et 7 mois. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I have a content template that uses the "Delete Post" CRED shortcode.
[cred_delete_post_link class='listing-trash-button cred-refresh-after-delete text-danger' text='Delete' action='trash']
Its problematic to give that level of functionality to users.
Instead, I'd like to give users the ability to change the "Post Status" to "draft".
Is there a shortcode for that?
Or can you recommend a code snippet to create a custom shortcode?
Actually there is a simpler way of doing this and it can be done with just our CRED plugin.
What you need to do is to create an edit form for that post type. Set the form setting for Post Status to "Draft". Then remove all the fields from your form except the submit button.
Form there you need to save your form and then just add your form to the page.
What will happen is that the user will see the button and when clicked it will change the post status to draft.
One thing maybe I need though.
It would be nice to get a warning message after clicking the "Submit" button on the form.
Something like "Are you sure you don't want to run this listing any longer?"
Is that possible within ToolSet, without resorting to custom code?