Tell us what you are trying to do?
I have 4 post types, Companies, Services, Portfolios and Promo Codes. I have 4 subscription plans on my site and each subscription plan assigns a user role to the subscriber. As an example, if a subscriber subscribes to the free plan, he is assigned to the user role "start-up" and he can only post 1 company, 1 service, 1 portfolio etc.
So based on the link (provided below) this is a good starting point, however, if the subscriber doesn't has the required permission based on his user role, I want to redirect it to an upgrade URL where he can upgrade his account to be able to add more post.
Is there any documentation that you are following?
Yes, I saw this topic but I need more guidelines to achieve what I need to achieve https://toolset.com/forums/topic/limiting-cred-form-submission-to-one-post/#
Is there a similar example that we can see?
N/A
What is the link to your site?
hidden link
Hello,
Yes, you can use filter hook "cred_form_validate" to limit thenumber of posts created by current user by his role, see the solution in the thread you mentioned above:
https://toolset.com/forums/topic/limiting-cred-form-submission-to-one-post/#
But "cred_form_validate" filter hook does not redirect user by default, I suggest you setup the error message with HTML link to the "URL where he can upgrade his account", for example:
$errors['wpcf-user-validation']='<a href="<em><u>hidden link</u></em>">Limitation reached, ppgrade your account here ...</a>';
After user submit the post form, he can see the message, and click the link to that URL.