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

Modify field settings by extending this class. More...

Inheritance diagram for GravityView_Field:
GravityView_Field_Address GravityView_Field_Calculation GravityView_Field_Captcha GravityView_Field_Checkbox GravityView_Field_Created_By GravityView_Field_CreditCard GravityView_Field_Currency GravityView_Field_Custom GravityView_Field_Date GravityView_Field_Date_Created GravityView_Field_Email GravityView_Field_Entry_Approval GravityView_Field_Entry_Link GravityView_Field_FileUpload GravityView_Field_Hidden GravityView_Field_HTML GravityView_Field_Is_Approved GravityView_Field_Is_Fulfilled GravityView_Field_List GravityView_Field_MultiSelect GravityView_Field_Name GravityView_Field_Notes GravityView_Field_Number GravityView_Field_Other_Entries GravityView_Field_Page GravityView_Field_Password GravityView_Field_Payment_Amount GravityView_Field_Payment_Method GravityView_Field_Payment_Status GravityView_Field_Phone GravityView_Field_Post_Category GravityView_Field_Post_Content GravityView_Field_Post_Custom_Field GravityView_Field_Post_ID GravityView_Field_Post_Image GravityView_Field_Post_Tags GravityView_Field_Post_Title GravityView_Field_Quiz GravityView_Field_Quiz_Score GravityView_Field_Radio GravityView_Field_Section GravityView_Field_Select GravityView_Field_Source_URL GravityView_Field_Text GravityView_Field_Textarea GravityView_Field_Time GravityView_Field_Transaction_ID GravityView_Field_Transaction_Type GravityView_Field_Website GravityView_Field_Workflow_Final_Status GravityView_Field_Workflow_Step GravityView_Post_Excerpt

Public Member Functions

 __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
 
 $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
 

Protected Member Functions

 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

 $_custom_merge_tag = false
 
 $_field_id = ''
 
 $_field_options = array()
 

Private Member Functions

 field_support_options ()
 

Detailed Description

Modify field settings by extending this class.

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

Constructor & Destructor Documentation

__construct ( )

GravityView_Field constructor.

Definition at line 130 of file class-gravityview-field.php.

References GravityView_Fields\register().

Member Function Documentation

_filter_gform_custom_merge_tags (   $custom_merge_tags = array(),
  $form_id,
  $fields = array(),
  $element_id = '' 
)

Add custom merge tags to merge tag options.

DO NOT OVERRIDE.

Definition at line 291 of file class-gravityview-field.php.

References $form, $form_id, custom_merge_tags(), and GVCommon\get_form().

_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.

DO NOT OVERRIDE.

See also
replace_merge_tag Override replace_merge_tag() to handle any matches
Since
1.16
Parameters
string$textText to replace
array$formGravity Forms form array
array$entryEntry array
bool$url_encodeWhether to URL-encode output
Returns
string Original text if {_custom_merge_tag} isn't found. Otherwise, replaced text.

This prevents the gform_replace_merge_tags filter from being called twice, as defined in:

See also
GFCommon::replace_variables()
GFCommon::replace_variables_prepopulate()

Definition at line 211 of file class-gravityview-field.php.

References $entry, $form, and replace_merge_tag().

_filter_sortable_fields (   $not_sortable)

Use field settings to modify whether a field is sortable.

See also
GravityView_frontend::is_field_sortable
Since
1.15.3
Parameters
array$not_sortableExisting field types that aren't sortable
Returns
array

Definition at line 335 of file class-gravityview-field.php.

References $name.

add_entry_meta (   $entry_meta)

Add the custom entry meta key to make it searchable and sortable.

See also
https://www.gravityhelp.com/documentation/article/gform_entry_meta/
Parameters
array$entry_metaArray of custom entry meta keys with associative arrays
Returns
mixed

Definition at line 353 of file class-gravityview-field.php.

References $entry_meta_update_callback.

add_field_support (   $key = '',
$field_options 
)
add_sortable_field (   $fields)

Add the field to the Filter & Sort available fields.

Since
TODO
Parameters
array$fieldsSub-set of GF form fields that are sortable
Returns
array Modified $fields array to include approval status in the sorting dropdown

Definition at line 163 of file class-gravityview-field.php.

custom_merge_tags (   $form = array(),
  $fields = array() 
)
protected

Add custom Merge Tags to Merge Tag options, if custom Merge Tags exist.

Should be overridden if there's more than one Merge Tag to add or if the Merge Tag isn't {_custom_merge_tag}

Since
1.16
Parameters
array$formGF Form array
GF_Field[]$fields Array of fields in the form
Returns
array Merge tag array with label and tag keys based on class label and _custom_merge_tag variables

Definition at line 312 of file class-gravityview-field.php.

Referenced by _filter_gform_custom_merge_tags().

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

Tap in here to modify field options.

Here's an example:

$field_options['name_display'] = array(
    'type' => 'select',
    'label' => __( 'User Format', 'gravityview' ),
    'desc' => __( 'How should the User information be displayed?', 'gravityview'),
    'choices' => array(
        array(
        'value' => 'display_name',
        'label' => __('Display Name (Example: "Ellen Ripley")', 'gravityview'),
    ),
    array(
        'value' => 'user_login',
        'label' => __('Username (Example: "nostromo")', 'gravityview')
    ),
     'value' => 'display_name'
);
Parameters
array$field_options[description]
string$template_id[description]
string$field_id[description]
string$context[description]
string$input_type[description]
Returns
array [description]

Definition at line 461 of file class-gravityview-field.php.

References $field_id.

field_support_options ( )
private
Runs Filter:
gravityview_date_format Override the date format with a PHP date format
Parameters
[in,out]null | string$date_formatDate Format (default: null)
Runs Filter:
gravityview_field_support_options Modify the settings that a field supports
Parameters
array$optionsOptions multidimensional array with each key being the input name, with each array setting having type, label, desc and value (default values) keys

Definition at line 376 of file class-gravityview-field.php.

Referenced by add_field_support().

is_choice_value_enabled ( )
protected

Check whether the enableChoiceValue flag is set for a GF field.

Gets the current form ID, gets the field at that ID, then checks for the enableChoiceValue value.

protected

GFAPI::get_form

Since
1.17
Returns
bool True: Enable Choice Value is active for field; False: not active, or form invalid, or form not found.

Definition at line 482 of file class-gravityview-field.php.

References $field, $form, gravityview_get_field(), and gravityview_get_form_id().

Referenced by GravityView_Field_Checkbox\field_options(), GravityView_Field_Select\field_options(), and GravityView_Field_Radio\field_options().

replace_merge_tag (   $matches = array(),
  $text = '',
  $form = array(),
  $entry = array(),
  $url_encode = false,
  $esc_html = false 
)

Run GravityView filters when using GFCommon::replace_variables()

Instead of adding multiple hooks, add all hooks into this one method to improve speed

Since
1.8.4
Parameters
array$matchesArray of Merge Tag matches found in text by preg_match_all
string$textText to replace
array | bool$formGravity Forms form array. When called inside {
See also
GFCommon::replace_variables()} (now deprecated), false
Parameters
array | bool$entryEntry array. When called inside {
See also
GFCommon::replace_variables()} (now deprecated), false
Parameters
bool$url_encodeWhether to URL-encode output
bool$esc_htmlWhether to apply esc_html() to output
Returns
mixed

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

References $entry, and $value.

Referenced by _filter_gform_replace_merge_tags(), and GravityView_Field_Is_Approved\custom_merge_tags().

set_default_search_label (   $label = '',
  $gf_field = null,
  $field = array() 
)

Allow setting a default search label for search fields based on the field type.

Useful for entry meta "fields" that don't have Gravity Forms labels, like created_by

Since
1.17.3
Parameters
string$labelExisting label text, sanitized.
array$gf_fieldGravity Forms field array, as returned by GFFormsModel::get_field()
array$fieldField setting as sent by the GV configuration - has field, input (input type), and label keys
Returns
string

Definition at line 188 of file class-gravityview-field.php.

References $field, and $label.

Field Documentation

$_custom_merge_tag = false
protected

Definition at line 125 of file class-gravityview-field.php.

$_field_id = ''
protected
$_field_options = array()
protected

Definition at line 119 of file class-gravityview-field.php.

$_gf_field_class_name
Since
1.15.2
1.16.2.2 Changed access to public (previously, protected) string The name of a corresponding Gravity Forms GF_Field class, if exists

Definition at line 107 of file class-gravityview-field.php.

$contexts = array( 'single', 'multiple', 'edit', 'export' )

Definition at line 100 of file class-gravityview-field.php.

$default_search_label

Definition at line 36 of file class-gravityview-field.php.

$entry_meta_is_default_column = false

Definition at line 89 of file class-gravityview-field.php.

$entry_meta_key = null

Definition at line 76 of file class-gravityview-field.php.

$entry_meta_update_callback = null

Definition at line 83 of file class-gravityview-field.php.

Referenced by add_entry_meta().

$group

standard, advanced, post, pricing, meta, gravityview

Since
1.15.2 string The group belongs to this field in the field picker

Definition at line 43 of file class-gravityview-field.php.

$is_numeric

boolean Is field content number-based?

Since
1.15.2

Definition at line 69 of file class-gravityview-field.php.

$is_searchable = true

Definition at line 50 of file class-gravityview-field.php.

$is_sortable = true

boolean Can the field be sorted in search?

Since
1.15.2

Definition at line 63 of file class-gravityview-field.php.

$label
$name

Definition at line 18 of file class-gravityview-field.php.

Referenced by _filter_sortable_fields().

$search_operators

Definition at line 57 of file class-gravityview-field.php.


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