GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
Modify field settings by extending this class. More...
Public Member Functions | |
__construct () | |
GravityView_Field constructor. More... | |
_filter_gform_custom_merge_tags ( $custom_merge_tags=array(), $form_id=0, $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... | |
as_array () | |
Returns the field as an array to be used in field pickers. More... | |
field_options ( $field_options, $template_id, $field_id, $context, $input_type, $form_id) | |
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 , or add-ons More... | |
$icon = 'dashicons-admin-generic' | |
$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 () | |
Modify field settings by extending this class.
Definition at line 11 of file class-gravityview-field.php.
__construct | ( | ) |
GravityView_Field constructor.
Modify the field options based on the name of the field type
Auto-assign label from Gravity Forms label, if exists
Definition at line 145 of file class-gravityview-field.php.
References gravityview(), and GravityView_Fields\register().
_filter_gform_custom_merge_tags | ( | $custom_merge_tags = array() , |
|
$form_id = 0 , |
|||
$fields = array() , |
|||
$element_id = '' |
|||
) |
Add custom merge tags to merge tag options.
DO NOT OVERRIDE.
Definition at line 362 of file class-gravityview-field.php.
References GV\$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.
string | $text | Text to replace |
array | $form | Gravity Forms form array |
array | $entry | Entry array |
bool | $url_encode | Whether to URL-encode output |
Definition at line 290 of file class-gravityview-field.php.
References $entry, GV\$form, and replace_merge_tag().
_filter_sortable_fields | ( | $not_sortable | ) |
Use field settings to modify whether a field is sortable.
array | $not_sortable | Existing field types that aren't sortable |
Definition at line 406 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.
array | $entry_meta | Array of custom entry meta keys with associative arrays |
Definition at line 424 of file class-gravityview-field.php.
References $entry_meta_update_callback, and gravityview().
add_field_support | ( | $key, | |
& | $field_options | ||
) |
string | $key | |
array | $field_options |
Definition at line 508 of file class-gravityview-field.php.
References field_support_options().
Referenced by GravityView_Field_Post_Image\field_options(), GravityView_Field_Post_Content\field_options(), GravityView_Post_Excerpt\field_options(), GravityView_Field_Post_Tags\field_options(), GravityView_Field_Post_Title\field_options(), GravityView_Field_Website\field_options(), GravityView_Field_Post_ID\field_options(), GravityView_Field_Date\field_options(), GravityView_Field_Date_Created\field_options(), GravityView_Field_Date_Updated\field_options(), GravityView_Field_Workflow_Current_Status_Timestamp\field_options(), GravityView_Field_Entry_Link\field_options(), GravityView_Field_Post_Category\field_options(), and GravityView_Field_Time\field_options().
add_sortable_field | ( | $fields | ) |
Add the field to the Filter & Sort available fields.
array | $fields | Sub-set of GF form fields that are sortable |
Definition at line 242 of file class-gravityview-field.php.
as_array | ( | ) |
Returns the field as an array to be used in field pickers.
Definition at line 191 of file class-gravityview-field.php.
References $gf_field, $icon, GV\description, and gravityview().
|
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}
array | $form | GF Form array |
GF_Field[] | $fields Array of fields in the form |
label
and tag
keys based on class label
and _custom_merge_tag
variables Definition at line 383 of file class-gravityview-field.php.
Referenced by _filter_gform_custom_merge_tags().
field_options | ( | $field_options, | |
$template_id, | |||
$field_id, | |||
$context, | |||
$input_type, | |||
$form_id | |||
) |
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' );
array | $field_options | [description] |
string | $template_id | [description] |
string | $field_id | [description] |
string | $context | [description] |
string | $input_type | [description] |
Definition at line 549 of file class-gravityview-field.php.
References $field_id.
|
private |
gravityview_date_format
Override the date format with a PHP date format null | string | $date_format | Date Format (default: null) |
gravityview_field_support_options
Modify the settings that a field supports array | $options | Options 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 447 of file class-gravityview-field.php.
Referenced by add_field_support().
|
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
Definition at line 570 of file class-gravityview-field.php.
References $field, GV\$form, Utils\_POST(), gravityview(), gravityview_get_field(), and gravityview_get_form_id().
Referenced by GravityView_Field_Radio\field_options(), GravityView_Field_Select\field_options(), GravityView_Field_Checkbox\field_options(), and GravityView_Field_MultiSelect\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
array | $matches | Array of Merge Tag matches found in text by preg_match_all |
string | $text | Text to replace |
array | bool | $form | Gravity Forms form array. When called inside { |
false
array | bool | $entry | Entry array. When called inside { |
false
bool | $url_encode | Whether to URL-encode output |
bool | $esc_html | Whether to apply esc_html() to output |
Definition at line 321 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
string | $label | Existing label text, sanitized. |
array | $gf_field | Gravity Forms field array, as returned by GFFormsModel::get_field() |
array | $field | Field setting as sent by the GV configuration - has field , input (input type), and label keys |
Definition at line 267 of file class-gravityview-field.php.
|
protected |
Definition at line 140 of file class-gravityview-field.php.
|
protected |
Definition at line 128 of file class-gravityview-field.php.
Referenced by GravityView_Field_Time\_filter_date_display_date_format().
|
protected |
Definition at line 134 of file class-gravityview-field.php.
$_gf_field_class_name |
Definition at line 122 of file class-gravityview-field.php.
$contexts = array( 'single', 'multiple', 'edit', 'export' ) |
Definition at line 101 of file class-gravityview-field.php.
$default_search_label |
Definition at line 36 of file class-gravityview-field.php.
$description |
Definition at line 25 of file class-gravityview-field.php.
Referenced by GravityView_Field_Consent\__construct(), and GravityView_Field_Post_Image\explode_value().
$entry_meta_is_default_column = false |
Definition at line 90 of file class-gravityview-field.php.
$entry_meta_key = null |
Definition at line 77 of file class-gravityview-field.php.
$entry_meta_update_callback = null |
Definition at line 84 of file class-gravityview-field.php.
Referenced by add_entry_meta().
$group |
standard
, advanced
, post
, pricing
, meta
, gravityview
, or add-ons
Definition at line 44 of file class-gravityview-field.php.
$icon = 'dashicons-admin-generic' |
Definition at line 115 of file class-gravityview-field.php.
Referenced by as_array().
$is_numeric |
boolean Is field content number-based?
Definition at line 70 of file class-gravityview-field.php.
$is_searchable = true |
Definition at line 51 of file class-gravityview-field.php.
$is_sortable = true |
boolean Can the field be sorted in search?
Definition at line 64 of file class-gravityview-field.php.
$label |
Definition at line 31 of file class-gravityview-field.php.
Referenced by GravityView_Field_Workflow_Final_Status\__construct(), GravityView_Field_Workflow_Step\__construct(), GravityView_Field_Date_Updated\__construct(), GravityView_Field_Date_Created\__construct(), GravityView_Field_Is_Fulfilled\__construct(), GravityView_Field_List\_filter_field_label(), GravityView_Field_Password\field_label(), GravityView_Field_Workflow_Step\modify_gravityview_search_field_step_label(), and set_default_search_label().
$name |
Definition at line 18 of file class-gravityview-field.php.
Referenced by _filter_sortable_fields().
$search_operators |
Definition at line 58 of file class-gravityview-field.php.