Description
This filter is executed when creating the address street 2 field and can be used to modify the “Street 2” label.
Usage
Applies to all forms.
1 | add_filter( 'gform_address_street2' , 'change_address_street2' , 10, 2 ); |
Applies to a specific form. In this case, form id 5.
1 | add_filter( 'gform_address_street2_5' , 'change_address_street2' , 10, 2 ); |
Parameters
Examples
This example changes the default address street 2 label:
1 2 3 4 | add_filter( 'gform_address_street2' , 'change_address_street2' , 10, 2 ); function change_address_street2( $label , $form_id ) { return "Address Street 2" ; } |
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in js.php and GF_Field_Address::get_field_input() in includes/fields/class-gf-field-address.php.