gform_address_state_<rgget>

The Gravity Forms gform address state rgget hook.

Description

apply_filters( 'gform_address_state_<rgget>', $var, $rgget ); 

Parameters (2)

0. $var
__( 'State / Province', 'gravityforms' )
1. $rgget
The rgget.

Usage

To run the hook, copy the example below.
  1. $var = apply_filters( 'gform_address_state_{$rgget}', $var, $rgget ); 
  2.  
  3. if ( !empty( $var ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the gform_address_state_<rgget> callback 
  2. function filter_gform_address_state_rgget( $var, $rgget ) { 
  3. // make filter magic happen here... 
  4. return $var
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "gform_address_state_{$rgget}", 'filter_gform_address_state_rgget', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "gform_address_state_{$rgget}", 'filter_gform_address_state_rgget', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/js.php  
  1. new Input(field.id + 0.4, <?php echo json_encode( gf_apply_filters( array( 'gform_address_state', rgget( 'id' ) ), __( 'State / Province', 'gravityforms' ), rgget( 'id' ) ) ); ?>), new Input(field.id + 0.5, <?php echo json_encode( gf_apply_filters( array( 'gform_address_zip', rgget( 'id' ) ), esc_html__( 'ZIP / Postal Code', 'gravityforms' ), rgget( 'id' ) ) ); ?>), new Input(field.id + 0.6, <?php echo json_encode( gf_apply_filters( array( 'gform_address_country', rgget( 'id' ) ), esc_html__( 'Country', 'gravityforms' ), rgget( 'id' ) ) ); ?>)];