I've tried to duplicate a similar solution to the one discussed around this topic, but each time it involved custom code that solved the problem to the specific user. I've tried using the "view" trick as explained at the end of the article, here:
https://toolset.com/documentation/legacy-features/views-plugin/how-to-create-custom-searches-and-relationships-for-users/
But there was either missing document or the new Toolset version doesn't support the required options.
Next, I tried customizing the code I founded in these threads to my website:
https://toolset.com/forums/topic/cred-before-save-data-allow-only-one-submition-of-the-form/#post-922696
But I don't know any code, so I was mostly guessing where I needed to change things. The cred_form_validate hook was mentioned several times, so I imagine the solution requires this.
Hello and thank you for contacting the Toolset support.
Instead of using custom code, you can use a view that will check if the user has already created the number of allowed posts. Then you can put the form, using a shortcode, inside the view if no posts are found. Does it make sense?
If you are using the legacy editor for building view, you can put the form inside the wpv-no-items-found shortcode. Check this screenshot hidden link
If you are using the blocks editor for building the view, you can put the form in the loop template of the view's loop. Check this screenshot hidden link
I hope this helps. Let me know if you have any questions.
Hi Jamal,
Your solution sounds really good, but for some reason it's not working for me. Here's what I did:
I created a view that selects the post type users create with the form.
I left it completely blank and entered the shortcode: [cred_form form="2580"] using the form's ID. I have also tried inserting the name of the form before using the ID.
I created a completely new user so that it will be the first time he creates the form, but nothing appeared where the view was located. Simply blank.
Did I miss something?
Thanks for the help,
Tom
Hello Tom, and thank you for your feedback.
Would you like to allow me temporary access to check this view closely? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
The view returns one Designer. hidden link
The form will display only when the view does not return anything
I changed the status of the post to Draft, so it won't be returned by the view and the form appeared. hidden link
I assume that you want the view to query only the posts that were created by the user, right?
I that case, you need to add a query filter on the author field. hidden link
My issue is resolved now. Thank you!