Skip Navigation

[Resolved] Restrict post form to only allow one submission

This support ticket is created 5 years, 6 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
- 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by orlaF 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1281341

My post type is 'licenced-coach'

I have a post form (Post Form > Add New Content) that allows logged in users to create their profile. However, I only want that form to show while the user has not added their profile. Once their profile has been added - I would like to show a link to edit that form.

Is it possible to create a conditional statement something like this:
[if the current logged in user's number of 'licenced-coach' posts = 0] SHOW FORM [end condition]
[if the current logged in user's number of 'licenced-coach' posts >= 1] SHOW EDIT BUTTON [end condition]

Kind Regards,
Orla

#1281457

Hello,

It is possible with Views, for example, you can create a post view:
- Query 'licenced-coach' posts
- Filter by post author is current logged in user:
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/
- In section "Loop Editor":
a) within Views loop <wpv-loop>...</wpv-loop>, display the edit form link:
https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-editing/
b) within [wpv-no-items-found]... [/wpv-no-items-found] shortcodes, display add new post form link.

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-no-items-found

#1281517

Dear Orla,

I have changed your post to private message, it is not safe to share the credentials publicly.

And I have tried the credentials you provided above, it is not valid, I get this error message:
ERROR: Invalid email address

So, please provide an valid credentials in below private message box, thanks

#1281589

Thanks for the details, I can see the problem in your website, the author filters does not work in the problem page, the problem is abnormal, please check these:

1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

If the problem is fixed, activate other plugins/theme one by one, try to locate the problem plugin/theme

#1282963

The issue was conflicting custom code - it is resolved now. Thank you!