PluginProbe
Customify / 2.3.0
Customify v2.3.0
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 / views / form-partials / fields / multicheckbox.php

multicheckbox.php in Customify 2.3.0, at views/form-partials/fields/multicheckbox.php

37 lines 1.0 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 $option = get_option( 'pixcustomify_settings' );
17 $attrs = array(
18 'type' => 'checkbox',
19 );
20 ?>
21 <div class="multicheckbox">
22 <?php
23 foreach ( $this->getmeta( 'options', array() ) as $value => $label ) {
24 $attrs['name'] = $name . '[' . $value . ']';
25
26 if ( is_array($selected) && array_key_exists( $value, $selected) ) {
27 $attrs['checked'] = 'checked';
28 } else {
29 unset($attrs['checked']);
30 } ?>
31 <fieldset class="multicheckbox_option">
32 <input <?php echo $field->htmlattributes( $attrs ) ?>>
33 <label id="<?php echo $value ?>"><?php echo $label ?></label>
34 </fieldset>
35 <?php } ?>
36 </div>
37