GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
templates
deprecated
fields
select.php
Go to the documentation of this file.
1
<?php
2
/**
3
* Display the select field type
4
*
5
* @package GravityView
6
* @subpackage GravityView/templates/fields
7
*/
8
9
$gravityview_view
=
GravityView_View::getInstance
();
10
11
extract(
$gravityview_view
->getCurrentField() );
12
13
/**
14
* @filter `gravityview/fields/select/output_label` Override whether to show the value or the label of a Select field
15
* @since 1.5.2
16
* @param bool $show_label True: Show the label of the Choice; False: show the value of the Choice. Default: `false`
17
* @param array $entry GF Entry
18
* @param GF_Field_Select $field Gravity Forms Select field
19
*/
20
$show_label
= apply_filters(
'gravityview/fields/select/output_label'
, (
'label'
=== \
GV
\Utils::get(
$field_settings
,
'choice_display'
) ),
$entry
,
$field
);
21
22
if
(
$show_label
&& !empty(
$field
->choices ) && is_array(
$field
->choices ) &&
''
!==
$display_value
) {
23
$output
= RGFormsModel::get_choice_text(
$field
,
$display_value
);
24
}
else
{
25
$output
=
$display_value
;
26
}
27
28
echo
$output
;
GravityView_View\getInstance
static getInstance( $passed_post=NULL)
Definition:
class-template.php:195
$display_value
$display_value
Definition:
field-address-csv.php:17
GV
$field_settings
$field_settings['content']
Definition:
custom.php:27
$show_label
$show_label
Definition:
select.php:20
$gravityview_view
$gravityview_view
Definition:
select.php:9
$field
$field
Definition:
search-field-chainedselect.php:29
$output
$output
Definition:
edit_link.php:18
$entry
$entry
Definition:
notes.php:27