Skip Navigation

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

This thread is resolved. Here is a description of the problem and solution.

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 5 years, 7 months ago. 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.

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)

Author
Posts
#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: hidden link

Toolset Post Forms Frontend Access: hidden link

#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!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.