gppr_validation_messages

  1. Description
  2. Usage
  3. Parameters
  4. Example
    1. Modify Validation Messages
  5. Since

Description

Filter the validation messages that will be displayed if a price is outside of the selected range.

Usage

Filter price range validation messages on all price fields on all forms.

add_filter( 'gppr_validation_messages', 'my_custom_function', 10, 5 );

Filter price range validation messages on all price fields on a specific form.

add_filter( 'gppr_validation_messages_FORMID', 'my_custom_function', 10, 5 );

Filter price range validation messages on a specific price field on a specific form.

add_filter( 'gppr_validation_messages_FORMID_FIELDID', 'my_custom_function', 10, 5 );

Parameters

  • messages array

    An array of validation messages that are used if a price is outside of a specified range.

    • min_and_max string

      Validation message if out of range and both min and max are provided.

    • min string

      Validation message if below minimum price.

    • max string

      Validation message if above maximum price.

  • min int

    The minimum price.

  • max int

    The maximum price.

  • form_id int

    The current form ID.

  • field_id int

    The current field ID.

Example

Modify Validation Messages

This example provides the base messages generated by the plugin. Use this as a starting point and change the messages as needed.

View Snippet

Since

This filter is available since Gravity Forms Price Range 1.0.4.