Skip Navigation

[Resolved] Make limitation to submit post

This support ticket is created 6 years, 8 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#672365

Hi there....

Thanks for help me for the expiration post... I need some help for submitted post....

It's any method to make limitation for user to submit the post? For example, a user can submit only 3 post...

Thanks...

#672814

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

If your users are submitting content with CRED forms then you would have a couple of alternatives, each of which requires writing some custom code.

The first would be to not display the form to submit posts at all if the user had already published the maximum number of posts.

For this you would need to register a custom function or shortcode that ran a query to get the posts of that user and return the count. You could then use that in a wpv-conditional shortcode (after registering the shortcode or function at Toolset > Settings > Front-end Content) which you use to either reveal or hide the form to publish content.

See https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ about conditionally showing content.

The second option would be to allow users to see the form and try to submit content, but use custom validation to reject the form if the user had already submitted the maximum number of posts (which would again require a custom query to get the posts of that user), using the cred_validate_form hook: https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

If you prefer one or the other and need help, let me know.