Home / Admin / Changing Sublabels for the Email Field
Duplicate Snippet

Embed Snippet on Your Site

Changing Sublabels for the Email Field

This snippet is used to update the default labels for the Email field when it includes Email and Confirm Email subfields.

<10
Code Preview
php
<?php
/**
 * Customize email field properties.
 *
 * @link https://wpforms.com/developers/how-to-change-sublabels-for-the-email-field/
 */
function wpf_dev_email_field_properties( $properties, $field, $form_data ) {
    // Change sublabel values
    $properties[ 'inputs' ][ 'primary' ][ 'sublabel' ][ 'value' ]   = __( 'Enter Your Email', 'plugin-domain' );
    $properties[ 'inputs' ][ 'secondary' ][ 'sublabel' ][ 'value' ] = __( 'To confirm, re-enter your email address here', 'plugin-domain' );
    return $properties;
}
add_filter( 'wpforms_field_properties_email' , 'wpf_dev_email_field_properties', 10, 3 );

Comments

Add a Comment