Skip Navigation

[Closed] Switch for creation and editing of a single CPT by a user

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 2 years ago.

Assisted by: Minesh.

Author
Posts
#2631253

Tell us what you are trying to do?
I want to give the user the option to create only one CPT (Custom Post Type) post. For this purpose, I am using the submission form with a connection to this post: https://toolset.com/forums/topic/limit-post-count-per-subscriber-to-1-post-forever/#post-266572. Once the user has created this post and clicks on the "Create post" button again, they should be able to see and edit their already created post. I am aware that I could solve this with two separate forms, but that would mean I have to maintain both separately whenever there's a change. Is there a way to achieve this using a single form, with a switch such as if the user has already created a post (post count > 0), show the edit form with their post, otherwise show the creation form?
Is there any documentation that you are following?
https://toolset.com/forums/topic/limit-post-count-per-subscriber-to-1-post-forever/#post-266572
Is there a similar example that we can see?
Not that I am aware of.
What is the link to your site?
hidden link
The website is currently under construction, and to perform a more in-depth inspection, I would need to create a new user first.

#2631627

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Actually - you can not have one form for both Add and Edit purpose. You will have to create two forms one for Add content and another for edit content.

To control when to display add form and when to display the Edit link we can use the conditional display to control that.

If you agree, you should create both add and edit form:
add form:
- https://toolset.com/course-lesson/front-end-forms-for-adding-content/

Edit form:
- https://toolset.com/course-lesson/front-end-forms-for-editing-content/

Once you setup both the form let me know and we will handle the conditional display of the form to display Add button or Edit link.

In addition to that - Could you please send me debug information that will help us to investigate your issue.
=> https://toolset.com/faq/provide-debug-information-faster-support/

The topic ‘[Closed] Switch for creation and editing of a single CPT by a user’ is closed to new replies.