Skip Navigation

[Resolved] Toolset form: set post visibility

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 3 months ago.

Assisted by: Waqar.

Author
Posts
#2680123

I'm creating a site where visitor can create an account and after that he can create custom posts with toolset form. Now I want to let the visitor choose the visiblity of the post so that they can keep it private (default) or give it password access or publish it.

Can't find any example how to do this, is it possible?

#2680241

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

To achieve this, you can use different Toolset edit post forms, one for each post status change. i.e.

a). Form to set the post status to 'private'
b). Form to set the post status to 'publish'
c). Form to set the post status to 'password protected'

These forms will not have any fields and just the submit button, as the goal of each, will only be to trigger the relevant change in the post status.

The 'Private' and 'Published' post status options are available in the form, out-of-the-box. But for the 'password protected' form some extra customization will be needed.

In that form, you'll need a generic field for a password and then a custom function attached to a 'cred_save_data' hook, to set this post as password protected with that entered password.

You'll find an example of a custom function for a similar requirement, in the following forum reply:
https://toolset.com/forums/topic/password-protect-custom-posts-with-toolset-forms/#post-1452647

I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#2680242

Thank you Waqar, that's brilliant!

katjaL confirmed that the issue was resolved on 2024-01-27 11:57:19.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.