PluginProbe
Customify / 2.3.3
Customify v2.3.3
2.10.9 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.7.1 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.6.0 1.6.0.1 1.6.5 1.7.0 1.7.1 All 77 releases
customify / core / views / form-partials / fields / select.php

select.php in Customify 2.3.3, at core/views/form-partials/fields/select.php

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php defined( 'ABSPATH' ) or die;
2 /* @var PixCustomifyFormField $field */
3 /* @var PixCustomifyForm $form */
4 /* @var mixed $default */
5 /* @var string $name */
6 /* @var string $idname */
7 /* @var string $label */
8 /* @var string $desc */
9 /* @var string $rendering */
10
11 // [!!] the counter field needs to be able to work inside other fields; if
12 // the field is in another field it will have a null label
13
14 $selected = $form->autovalue( $name, $default );
15
16 $attrs = array
17 (
18 'name' => $name,
19 'id' => $idname,
20 );
21
22 // group show
23
24 if ($field->hasmeta('show_group')) {
25 $attrs['data-show_group'] = $field->getmeta('show_group');
26 }
27
28 if ($field->hasmeta('display_option')) {
29 $attrs['data-display_option'] = $field->getmeta('display_option');
30 }?>
31 <div class="select">
32 <label id="<?php echo $name ?>"><?php echo $label ?></label>
33 <select <?php echo $field->htmlattributes( $attrs ) ?>>
34 <?php foreach ( $this->getmeta( 'options', array() ) as $key => $label ): ?>
35 <option <?php if ($key == $selected): ?>selected<?php endif; ?>
36 value="<?php echo $key ?>">
37 <?php echo $label ?>
38 </option>
39 <?php endforeach; ?>
40 </select>
41 </div>
42