GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
field-multiselect-html.php
Go to the documentation of this file.
1 <?php
2 /**
3  * The default select field output template.
4  *
5  * @global \GV\Template_Context $gravityview
6  * @since 2.0
7  */
8 
9 if ( ! isset( $gravityview ) || empty( $gravityview->template ) ) {
10  gravityview()->log->error( '{file} template loaded without context', array( 'file' => __FILE__ ) );
11  return;
12 }
13 
14 $field = $gravityview->field->field;
15 $entry = $gravityview->entry->as_entry();
16 $field_settings = $gravityview->field->as_configuration();
17 
18 /**
19  * @filter `gravityview/fields/select/output_label` Override whether to show the value or the label of a Select field
20  * @since 1.5.2
21  * @param bool $show_label True: Show the label of the Choice; False: show the value of the Choice. Default: `false`
22  * @param array $entry GF Entry
23  * @param GF_Field_Select $field Gravity Forms Select field
24  * @since 2.0
25  * @param \GV\Template_Context $gravityview The context
26  */
27 $show_label = apply_filters( 'gravityview/fields/select/output_label', ( 'label' === \GV\Utils::get( $field_settings, 'choice_display' ) ), $entry, $field, $gravityview );
28 
29 $output = $field->get_value_entry_detail( $gravityview->value, '', $show_label );
30 
31 echo $output;
if(! isset( $gravityview)||empty( $gravityview->template)) $field
The default select field output template.
gravityview()
The main GravityView wrapper function.