GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
type_multiselect.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display admin multiselect field type
4  * @since 1.17.3
5  */
6 
7 /**
8  * multiselect
9  */
11 
12  function render_option() {
13  ?>
14  <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
15 
16  echo '<span class="gv-label">'.$this->get_field_label().'</span>';
17 
18  echo $this->get_tooltip() . $this->get_field_desc();
19 
20  $this->render_input();
21 
22  ?>
23  </label>
24  <?php
25  }
26 
27  function render_input( $override_input = null ) {
28 
29  if( isset( $override_input ) ) {
30  echo $override_input;
31  return;
32  }
33 
34  ?>
35  <select name="<?php echo esc_attr( $this->name ); ?>[]" id="<?php echo $this->get_field_id(); ?>" multiple="multiple">
36  <?php foreach( $this->field['options'] as $value => $label ) : ?>
37  <option value="<?php echo esc_attr( $value ); ?>" <?php selected( in_array( $value, (array)$this->value ), true, true ); ?>><?php echo esc_html( $label ); ?></option>
38  <?php endforeach; ?>
39  </select>
40  <?php
41  }
42 }
get_field_desc()
Retrieve field description.
render_input($override_input=null)
Display admin multiselect field type.
Modify option field type by extending this class.