GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Data Fields | Private Member Functions | Static Private Member Functions
GravityView_Field_Address Class Reference

Add custom options for address fields. More...

Inheritance diagram for GravityView_Field_Address:
GravityView_Field

Public Member Functions

 __construct ()
 
 field_options ($field_options, $template_id= '', $field_id= '', $context= '', $input_type= '')
 
 input_types ($input_types)
 Add the input types available for each custom search field type. More...
 
 search_bar_input_type ($input_type, $field_type, $field_id)
 Converts the custom input type (address) into the selected type. More...
 
- Public Member Functions inherited from GravityView_Field
 __construct ()
 GravityView_Field constructor. More...
 
 _filter_gform_custom_merge_tags ($custom_merge_tags=array(), $form_id, $fields=array(), $element_id= '')
 Add custom merge tags to merge tag options. More...
 
 _filter_gform_replace_merge_tags ($text, $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
 Match the merge tag in replacement text for the field. More...
 
 _filter_sortable_fields ($not_sortable)
 Use field settings to modify whether a field is sortable. More...
 
 add_entry_meta ($entry_meta)
 Add the custom entry meta key to make it searchable and sortable. More...
 
 add_field_support ($key= '', &$field_options)
 
 add_sortable_field ($fields)
 Add the field to the Filter & Sort available fields. More...
 
 field_options ($field_options, $template_id, $field_id, $context, $input_type)
 Tap in here to modify field options. More...
 
 replace_merge_tag ($matches=array(), $text= '', $form=array(), $entry=array(), $url_encode=false, $esc_html=false)
 Run GravityView filters when using GFCommon::replace_variables() More...
 
 set_default_search_label ($label= '', $gf_field=null, $field=array())
 Allow setting a default search label for search fields based on the field type. More...
 

Data Fields

 $_gf_field_class_name = 'GF_Field_Address'
 
 $group = 'advanced'
 
 $is_numeric = false
 
 $is_searchable = true
 
 $name = 'address'
 
- Data Fields inherited from GravityView_Field
 $_gf_field_class_name
 
 $contexts = array( 'single', 'multiple', 'edit', 'export' )
 
 $default_search_label
 
 $description
 
 $entry_meta_is_default_column = false
 
 $entry_meta_key = null
 
 $entry_meta_update_callback = null
 
 $group
 standard, advanced, post, pricing, meta, gravityview More...
 
 $is_numeric
 boolean Is field content number-based? More...
 
 $is_searchable = true
 
 $is_sortable = true
 boolean Can the field be sorted in search? More...
 
 $label
 
 $name
 
 $search_operators
 

Private Member Functions

 add_hooks ()
 Add filters for this field type. More...
 
 get_choices_country ($address_field)
 Get array of countries to use for the search choices. More...
 
 get_choices_state ($address_field)
 Get array of states to use for the search choices. More...
 

Static Private Member Functions

static get_input_type_from_input_id ($input_id)
 Get a name for the input based on the input ID. More...
 

Additional Inherited Members

- Protected Member Functions inherited from GravityView_Field
 custom_merge_tags ($form=array(), $fields=array())
 Add custom Merge Tags to Merge Tag options, if custom Merge Tags exist. More...
 
 is_choice_value_enabled ()
 Check whether the enableChoiceValue flag is set for a GF field. More...
 
- Protected Attributes inherited from GravityView_Field
 $_custom_merge_tag = false
 
 $_field_id = ''
 
 $_field_options = array()
 

Detailed Description

Add custom options for address fields.

Definition at line 11 of file class-gravityview-field-address.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 23 of file class-gravityview-field-address.php.

References add_hooks().

Member Function Documentation

add_hooks ( )
private

Add filters for this field type.

Since
1.19.2
Returns
void

Definition at line 38 of file class-gravityview-field-address.php.

References $field_id, $form, $search_field, GravityView_View\getInstance(), and gravityview_get_input_id_from_id().

Referenced by __construct().

field_options (   $field_options,
  $template_id = '',
  $field_id = '',
  $context = '',
  $input_type = '' 
)

Definition at line 250 of file class-gravityview-field-address.php.

References $field_id.

get_choices_country (   $address_field)
private

Get array of countries to use for the search choices.

Since
1.19.2
See also
GF_Field_Address::get_countries()
Parameters
GF_Field_Address$address_field
Returns
array Array of countries with value and text keys as the name of the country

Definition at line 103 of file class-gravityview-field-address.php.

get_choices_state (   $address_field)
private

Get array of states to use for the search choices.

Since
1.19.2

GF_Field_Address::get_us_states() GF_Field_Address::get_us_state_code() GF_Field_Address::get_canadian_provinces()

Parameters
GF_Field_Address$address_field
Returns
array Array of countries with value and text keys as the name of the country

Definition at line 132 of file class-gravityview-field-address.php.

References $form.

static get_input_type_from_input_id (   $input_id)
staticprivate

Get a name for the input based on the input ID.

Since
1.19.2
Parameters
int$input_idID of the specific input for the address field
Returns
false|string If the input ID matches a known address field input, returns a name for that input ("city", or "country"). Otherwise, returns false.

Definition at line 221 of file class-gravityview-field-address.php.

input_types (   $input_types)

Add the input types available for each custom search field type.

Since
1.19.2
Parameters
array$input_typesArray of input types as the keys (select, radio, multiselect, input_text) with a string or array of supported inputs as values
Returns
array $input_types array, but

Definition at line 169 of file class-gravityview-field-address.php.

search_bar_input_type (   $input_type,
  $field_type,
  $field_id 
)

Converts the custom input type (address) into the selected type.

Since
1.19.2
Parameters
string$input_typeAssign an input type according to the form field type. Defaults: boolean, multi, select, date, text
string$field_typeGravity Forms field type (also the name parameter of GravityView_Field classes)
string | int | float$field_idID of the field being processed
Returns
string If the field ID matches an address field input, return those options {
See also
GravityView_Field_Address::input_types() }. Otherwise, original value is used.

Definition at line 196 of file class-gravityview-field-address.php.

References $field_id, and gravityview_get_input_id_from_id().

Field Documentation

$_gf_field_class_name = 'GF_Field_Address'

Definition at line 21 of file class-gravityview-field-address.php.

$group = 'advanced'

Definition at line 15 of file class-gravityview-field-address.php.

$is_numeric = false

Definition at line 17 of file class-gravityview-field-address.php.

$is_searchable = true

Definition at line 19 of file class-gravityview-field-address.php.

$name = 'address'

Definition at line 13 of file class-gravityview-field-address.php.


The documentation for this class was generated from the following file: