• Resolved dapforu1

    (@dapforu1)


    Im trying to change the sublabel name on this form. I’m using gthe code below but im not getting any results.

    function wpf_dev_country_field_properties( $properties, $field, $form_data ) {

    // Change sublabel values
    $properties[‘inputs’][‘select country’][‘sublabel’][‘value’] = ‘Select Country’;

    return $properties;
    }
    add_filter( ‘wpforms_field_properties_country’ , ‘wpf_dev_country_field_properties’, 10, 3 );

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Ethan Choi

    (@ethanchoi)

    Hi @dapforu1,

    To do what you’ve described, please try the following code snippet:

    /**
    *
    * Change Address field sublabels for the 'International' address scheme
    *
    */
    
    function wpf_dev_address_field_properties( $properties, $field, $form_data ) {
      
      // check for address scheme
      if ( $field['scheme'] === 'international' ){
    	  // Change sublabel values
    	  $properties['inputs']['country']['sublabel']['value'] = 'Select Country';
      	}
        return $properties;
    }
    
    add_filter( 'wpforms_field_properties_address' , 'wpf_dev_address_field_properties', 10, 3 );
    

    In case it helps, here’s our tutorial with the most common ways to add custom code like this.

    For the most beginner-friendly option in that tutorial, I’d recommend using the Code Snippets plugin.

    Hope this helps 🙂

    Thread Starter dapforu1

    (@dapforu1)

    Works great. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Change “country” sub label to “Select Country”’ is closed to new replies.