# customify/2.3.0/views/form-partials/fields/multicheckbox.php

Customify, version 2.3.0. 37 lines.

- Page: https://pluginprobe.com/plugins/customify/2.3.0/code/views/form-partials/fields/multicheckbox.php
- Raw: https://pluginprobe.com/plugins/customify/2.3.0/raw/views/form-partials/fields/multicheckbox.php
- Modified: 2015-03-16T14:53:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/customify/2.3.0/code/views/form-partials/fields/multicheckbox.php#L10-L20`.

```php
<?php defined( 'ABSPATH' ) or die;
/* @var PixCustomifyFormField $field */
/* @var PixCustomifyForm $form */
/* @var mixed $default */
/* @var string $name */
/* @var string $idname */
/* @var string $label */
/* @var string $desc */
/* @var string $rendering */

// [!!] the counter field needs to be able to work inside other fields; if
// the field is in another field it will have a null label

$selected = $form->autovalue( $name, $default );

$option = get_option( 'pixcustomify_settings' );
$attrs = array(
	'type' => 'checkbox',
);
?>
<div class="multicheckbox">
	<?php
	foreach ( $this->getmeta( 'options', array() ) as $value => $label ) {
		$attrs['name'] = $name . '[' . $value . ']';

		if ( is_array($selected) && array_key_exists( $value, $selected) ) {
			$attrs['checked'] = 'checked';
		} else {
			unset($attrs['checked']);
		} ?>
		<fieldset class="multicheckbox_option">
			<input <?php echo $field->htmlattributes( $attrs ) ?>>
			<label id="<?php echo $value ?>"><?php echo $label ?></label>
		</fieldset>
	<?php } ?>
</div>

```
