1. Home
  2. Docs
  3. Forms Bouncer for WordPress wpForms
  4. Component Usage

Component Usage

This plugin relies on there being an active instance of a WPForm element within the same page/post of your website. It supports both WPForms Pro and WPForms Lite the same, so regardless which you use the behavior is the same.

Base Shortcode

To invoke the plugin you will need to make sure that you’re inserting it into a page also containing an instance of WPForms. From there you will need to know the ID for that WPForm so it can be targeted by the Forms Bouncer. You do not need to provide all of the shortcode arguments if you are alright with the defaults.

The most basic use of the Forms Bouncer shortcode would be the following:

     [wpFormsBouncer target='10']

This example invokes the shortcode and provides a target ID for the WPForm within the same page. For a more detailed explanation of the default argument values please read the section below.

IMPORTANT: You do not have to add every shortcode argument when using the plugin, and only need to provide overrides for your needs.

Shortcode Arguments

The WordPress shortcode to embed the Forms Bouncer plugin has several useful arguments to customize each instance. Each argument has default values that will be used unless you provide a different value.

Here is a full list of available arguments with sample values as a sample shortcode, followed by detailed explanations for each:

[wpFormsBouncer
    match = 'begin',
    pattern = '12345',
    length = 5,
    target = '10',
    description = 'Please enter your passcode',
    label = 'Passcode',
    error = ‘Invalid entry, please try again',
    placeholder = 'XXXXX',
    submit = 'Submit',
    customCSS = false,
    date = 'February 15, 2999 11:24:00'
]

Argument: match

The match argument determines how we will search for the pattern within the user’s provided passcode. This plug-in has the ability to search within the user’s passcode for a specific value that we will match, so it is possible to only care about only a portion of the user’s passcode to validate against your desired pattern

By default we match the beginning of the user’s passcode against the pattern but there are four availble matching modes: 

  • begin – searches the first part of the passcode for your required pattern, default matching mode
  • end – serches the ending of the passcode for your required pattern
  • contains – searches the entire passcode for one instance of your required pattern
  • match – exact match of the entire passcode to the pattern

Default: "begin"

Argument: pattern

The pattern represents what we want to find within the user’s input to validate that they have the proper information/permissions to see your wpForm. The pattern can be the entire value of the user’s input or it can be a part of the user’s input. You can specify alphanumeric values, or depending on the platform you should also be able to use emojis.

Default: "12345"

Argument: length

You have the ability to set the max length of the input field used to gather the user’s authentication attempt. This value must be the greater than or equal to the length of your pattern. 

The default length for the input field is 5 characters. If you need this to be any other length you will need to set this when implementing the shortcode. 

Default: 5

Argument: target

The numeric ID of the wpForm that an instance of the Bouncer will effect. Be sure to only place the form number as the value or we will not find your form within the page. 

Default: "10"

Argument: description

This text description serves as instructions to the user on what to do in order to get past the Bouncer and into the WPForm it is protecting. If the user does not enter the correct passcode when submitting the form the text here is replaced with the error text within the page.

Default: "Please enter your passcode"

Argument: label

This text is used as the text label accompanying the input field.

Default: "Passcode"

Argument: error

Message that will show to the user if they enter an incorrect value into the input field. 

Default: "Invalid entry, please try again"

Argument: placeholder

To increase accessibility, the input field will have preview text in it showing light grey text. You should attempt to make the preview text meaningful, either more descriptive text informing what the user should be doing or a string of characters the same length as the passcode you are requiring a user enter into the field. 

Default: "XXXXX"

Argument: submit

The text used for the button within the form bouncer can be set with this parameter.

Default: "Submit"

Argument: customCSS

A boolean value that determines if default CSS that ships with the Forms Bouncer plugin will be used. If you will be using your own CSS to style the form set this value to true so that the default CSS will not be applied.

Default: false

Argument: date

An inportant feature of this plugin is the ability to not activate itself within a page after a specified date. By setting this value with a valid date and time you can open up public access to your WPForm after a certain date without having to come back and edit the page.

By default we set the date to far in the future in case you would like to always have the Forms Bouncer activated. You only need to change this value if you’d like it to deactivate.

Default: "February 15, 2999 11:24:00"