cf_entry_limiter_entry_limit

An Image of a Kitten Sitting on Grass

Caldera Forms Entry Limiter SetupCaldera Forms Entry Limiter can be used to prevent a value from being used for a field more than a preset number of times. By default, each option of a field can be used the same number of times. In a scenario where you have a select field with three options, each representing an activity you want customers to sign up for and each activity has a different number of available slots for registration, you should use this filter. With this filter, you can assign a different number of unique values per option and therefore limit each activity to the right number of registered attendees.

This filter requires Entry Limiter version 1.2.0 or later.

Limit Number Of Entries Differently For Each Field Option

To use this example, first setup a select field with multiple options. Make sure to enable entry limiting on a field using the Limit Duplication checkbox. Then set a value for Duplication Limit that is the max number of registrants for the option with the most spaces. Optionally change the Fail Text setting to the right message to show when someone tries to register for an unavailable option.

Then, add the options you need. Setting up select options is documented here. Make sure that you set an a value and a label for each option. You will use the value in the filter code.

Once the field is setup, copy the field ID from the field settings. Then you can modify the example code below to fit your needs. Make sure to change the field ID (look at the first “IMPORTANT:” note in the code) in the function match your field ID.

Then you will need to adapt the conditional logic so that for each of your field options, you change the value of the variable $limit to be the right limit. In this example, we are making it so if someone chooses the first option “video-games” — note we are using value, not label — then the limit is reduced to 10.

Where Does This Code Go?

When using WordPress hooks to customize Caldera Forms or other plugins you should not modify the plugin files, or you will lose your changes when you update the plugin. Instead you should create a small plugin to hold the custom code. It's easy, learn how here.

Technically you can add the custom code to your theme's functions.php, but then you will not be able to change your theme and keep these customizations.

Learn More