Skip Navigation

[Resuelto] Multiple Submit Buttons On A Single Cred Form

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem: I would like to use different submit buttons in a Form to allow Users to change the post status manually. One button for "Pending Review", one button for "Publish", etc.

Solution: You can create 4 Forms, one for each post status. Remove the other input fields except the main CRED form shortcodes and the submit button shortcode. If the Form's only purpose is to modify the status of the post, then this could work.

This support ticket is created hace 6 años, 3 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Este tema contiene 1 respuesta, tiene 2 mensajes.

Última actualización por Christian Cox hace 6 años, 3 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#1096370

Tell us what you are trying to do?

I would like to add multiple buttons to a single cred form with each putting the post into a different status ie. one for draft status, pending review, and one for published. The purpose is because I would like to allow it to be editable in the draft status and then make it non-editable with pending review and or published. Is there a workaround to implement this?

Is there any documentation that you are following?

Looked through the cred form docs and some internet searches. Most information says one form one button.

Is there a similar example that we can see?

What is the link to your site?

The site is on a local enviroment.

#1096398

Hi, yes generally one Form contains one Submit button. But there's no reason you can't create 4 Forms, one for each post status. Remove the other input fields except the main CRED form shortcodes and the submit button shortcode. If the Form's only purpose is to modify the status of the post, then this could work.

On the other hand if the Form should allow Users to modify other parts of the post, then this approach won't be practical. Instead, you can use one Form with a generic radio field or a generic select field that contains 4 options - one for each post status. Then you can use the cred_save_data hook to modify the post status based on the selection in that field. Here's another ticket you can use as a reference: https://toolset.com/forums/topic/manage-native-wordpress-post-status-in-cred-form/

If you need more technical assistance with that I'm glad to help.