gpls_field_failed_validation

  1. Description
  2. Usage
  3. Parameters
  4. Since
  5. Examples
    1. Prevent GP Limit Submission validation errors from showing on fields

Description

Filter if fields that fail GP Limit Submissions rules should also show a validation error. Note, this does not impact form-wide validation.

Usage

Filter if all fields that fail GP Limit Submission rules should show a validation error.

add_filter( 'gpls_field_failed_validation', 'my_custom_function' );

Filter if all fields that fail GP Limit Submission rules should show a validation error in a given form.

add_filter( 'gpls_field_failed_validation_FORMID', 'my_custom_function' );

Filter if a specific field in a form that fails GP Limit Submission rules should show a validation error.

add_filter( 'gpls_field_failed_validation_FORMID_FIELDID', 'my_custom_function' );

Parameters

  • failed_validation boolean

    Whether or not the field should fail validation if the rule matches. This is set to true by default.

  • gpls_enforce_instance GPLS_Enforce

    The GPLS_Enforce instance.

Since

This filter is available since GP Limit Submissions 1.0-beta-1.21.

Examples

Prevent GP Limit Submission validation errors from showing on fields

This example prevents GP Limit Submission from showing validation errors on fields for form 123. Note, there will still be a form-wide validation error shown.

<?php
/**
 * Gravity Perks // Limit Submission // Prevent Validation Errors From Showing On Fields
 * https://gravitywiz.com/documentation/gravity-forms-limit-submissions/
 */
// Update "123" to your form ID.
add_filter( 'gpls_field_failed_validation_123', '__return_false' );