Skip Navigation

[Resolved] How to restrict submission of duplicate entry of a custom post type?

This support ticket is created 3 years 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
- 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 3 years ago.

Assisted by: Minesh.

Author
Posts
#2566957

How to restrict submission of duplicate entry of a custom post type by a user using toolset forms? For example your example site there a post type called events and another post type called venues. Now if anyone is going to submit a venue using toolset form and if the location the venue( google map location) is already exists as a venue in the venue archive then how to restrict that submission?

#2567699

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You can use the Toolset form's hook "cred_form_validate" to add validation for your form.

I would like to inform you that the Toolset map address field value is stored as post meta value to the postmeta table and it will be required for posts.

If your requirement is that a person X created entry with location Chicago and you do not want another person to add Chicago then you should check for validation but please note that "Chicago" and "Chicago, Illinois" will be different in comparison so you will have to make sure that there should not be duplicates.

More info:
- https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

Here are few related tickets that might help you:
- https://toolset.com/forums/topic/check-posted-data-to-avoid-duplicated-entries/
- https://toolset.com/forums/topic/need-to-validate-unique-values-in-post-field/#post-1201756