| 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 |
|