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
, andtrim
.
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