Skip Navigation

[Resuelto] Can Post forms be used by Guests to create posts?

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

Problem: Is it possible to allow Guests to create posts by submitting Forms? I have set permissions for these Forms in Access Controls, but I'm still having problems submitting the Forms.

Solution: In this case, it looks like the transcript field ( file upload field ) is required. Guests, by default, are not allowed to upload Media. In order for a Guest to be able to upload a file to the Media Library, you must use custom code to allow that permission. I added this code to your functions.php file:

add_action( 'admin_init','reset_guest_caps' ,9 );
function reset_guest_caps(){
    global $current_user, $wpcf_access;
    if(isset($_GET['formid']) && $_GET['formid']==126&&$current_user->ID==0)
    {
        $wpcf_access->settings=array();
    }
}
This support ticket is created hace 6 años, 2 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 7 respuestas, tiene 2 mensajes.

Última actualización por Gerard hace 6 años, 2 meses.

Asistido por: Christian Cox.

Autor
Mensajes
#1113670

Can Post forms be used by Guests to create posts?

We have a competition where people have to enter their form to participate and I'd like for them to create a post without needing to create an account.

Is there an option in Toolset, or otherwise, to achieve this?

Thanks

#1113907

Yes, it's possible. You can use Toolset Access to manage Guest capabilities for specific Forms. https://toolset.com/documentation/user-guides/access-control-for-cred-forms/
https://toolset.com/documentation/user-guides/setting-access-control/

You can set those Forms to publish immediately, or you can set those Forms to create content in some other status that requires an editor to review before publish.

#1113909

Hi,

I did, as far as I know..

#1113910

Post Type permissions: enlace oculto

Toolset Post Forms Frontend Access: enlace oculto

#1113918

It looks like those two links are the same. Can I log in and take a closer look in wp-admin? Please let me know where I can find the Form on the front-end of the site, and I will run some tests.

#1113926

It looks like the Transcript field is required. Guests, by default, are not allowed to upload Media. In order for a Guest to be able to upload a file to the Media Library, you must use custom code to allow that permission. I added this code to your functions.php file:

add_action( 'admin_init','reset_guest_caps' ,9 );
function reset_guest_caps(){
    global $current_user, $wpcf_access;
    if(isset($_GET['formid']) && $_GET['formid']==126&&$current_user->ID==0)
    {
        $wpcf_access->settings=array();
    }
}

Please be sure to pull down this change from the server to your local environment.

#1113928

YES!! It works!

Thank you for catching this! And for helping on a Sunday night!

#1113929

My issue is resolved now. Thank you!