gform_address_state_<form_id>
The Gravity Forms gform address state form id hook.
Description
Parameters (2)
- 0. $address_state_sub_label (unknown)
- The address state sub label.
- 1. $form_id
- The form id.
Usage
- To run the hook, copy the example below.
- $address_state_sub_label = apply_filters( 'gform_address_state_{$form_id}', $address_state_sub_label, $form_id );
- if ( !empty( $address_state_sub_label ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the gform_address_state_<form_id> callback
- function filter_gform_address_state_form_id( $address_state_sub_label, $form_id ) {
- // make filter magic happen here...
- return $address_state_sub_label;
- };
- // add the filter
- add_filter( "gform_address_state_{$form_id}", 'filter_gform_address_state_form_id', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( "gform_address_state_{$form_id}", 'filter_gform_address_state_form_id', 10, 2 );
Defined (4)
The filter is defined in the following location(s).
- /includes/fields/class-gf-field-address.php
- $address_state_sub_label = gf_apply_filters( array( 'gform_address_state', $form_id, $this->id ), $address_state_sub_label, $form_id );
- 'state_label' => gf_apply_filters( array( 'gform_address_state', $form_id ), esc_html__( 'State / Province / Region', 'gravityforms' ), $form_id )
- 'state_label' => gf_apply_filters( array( 'gform_address_state', $form_id ), esc_html__( 'State', 'gravityforms' ), $form_id ),
- 'state_label' => gf_apply_filters( array( 'gform_address_state', $form_id ), esc_html__( 'Province', 'gravityforms' ), $form_id ),