Description

Filter used to change the required field indicator for any required form fields.

Parameters

$text
(string) Text used indicate required fields.

Source

wpforms/includes/class-frontend.php

More Information

The wpforms_get_field_required_label filter is provided to retrieve and change the required field indicator.

Examples

/*
 * Whitelist email domains from your WPForms.
 *
 * @link https://wpforms.com/developers/wpforms_get_field_required_label/
 *
 * @param   string   $text   Text used indicate required fields.
 *
 * @return  string
*/
function wpf_dev_required_indicator( $text ) {
    return ' <span class="wpforms-required-label">(Required)</span>';
}
add_filter( 'wpforms_get_field_required_label', 'wpf_dev_required_indicator' );

Snippet Reference: How to Change Required Field Indicator