Documentation

gwp_sanitize

The gwp_sanitize modifier is a merge tag modifier that allows to display sanitized values.

Usage

The modifier can be used within any Gravity Forms merge tag by appending it with specific attributes that define the sanitization behavior. The basic syntax is as follows:

{field:1:gwp_sanitize type="sanitize_text_field"}

Attributes

  • type – Specifies the sanitization method to be applied. Options include sanitize_text_field, sanitize_title_with_dashes, and trim.

Supported Sanitization Types

  • sanitize_text_field – Utilizes WordPress’s sanitize_text_field() function to strip all tags and encode special characters from the string.
  • sanitize_title_with_dashes – Employs sanitize_title_with_dashes() to sanitize a title or slug, replacing whitespace and a few other characters with dashes.
  • trim – Simply trims whitespace from the beginning and end of the string using PHP’s trim() function.
  • absint – Converts a value to non-negative integer.

Last updated: 30-09-2024

Advanced Merge Tagsv1.7.2

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more