Description
The wpforms_get_field_required_label
filter is used to change the required field indicator for any required form fields.
Parameters
- $text
- (string) Text used to indicate required fields.
Source
wpforms/src/Frontend/Modern.php
More Information
The wpforms_get_field_required_label
filter is provided to retrieve and change the required field indicator.
Please note this filter can also be found in wpforms/src/Frontend/Classic.php
.
Examples
/* * Whitelist email domains from your WPForms. * * @link https://wpforms.com/developers/wpforms_get_field_required_label/ * * @param string $text Text used to 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', 10, 1 );