gform_consent_checked_indicator_markup

Description

The โ€œgform_consent_checked_indicator_markupโ€ filter in Gravity Forms allows the HTML markup of the Consent check box to be modified.

Usage

add_filter( 'gform_consent_checked_indicator_markup', 'your_function_name', 10, 1 );

Parameters

  • $checked_indicator_markup string

    The current HTML markup.

Examples

1
2
3
4
5
6
7
add_filter( 'gform_consent_checked_indicator_markup', function ( $markup ) {
    $fragment = WP_HTML_Processor::create_fragment( $markup );
    $fragment->next_token();
    $fragment->set_attribute( 'alt', 'Consent checkmark' );
 
    return $fragment->get_updated_html();
}, 10, 1 );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Since

This filter was added in Gravity Forms 2.4.

Source Code

This filter is located in GF_Field_Consent::__construct() in gravityforms/includes/fields/class-gf-field-consent.php.