# give/4.16.9/src/Framework/FieldsAPI/LegacyNodes/CheckboxGroup.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.16.9. 54 lines.

- Page: https://pluginprobe.com/plugins/give/4.16.9/code/src/Framework/FieldsAPI/LegacyNodes/CheckboxGroup.php
- Raw: https://pluginprobe.com/plugins/give/4.16.9/raw/src/Framework/FieldsAPI/LegacyNodes/CheckboxGroup.php
- Modified: 2023-06-09T00:46:40+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/give/4.16.9/code/src/Framework/FieldsAPI/LegacyNodes/CheckboxGroup.php#L10-L20`.

```php
<?php

namespace Give\Framework\FieldsAPI\LegacyNodes;

use Give\Framework\FieldsAPI\Concerns;
use Give\Framework\FieldsAPI\Field;

/**
 * This class is a legacy node for the old Form Field Manager Checkbox field. It should not be used in any other context
 * and will be eventually be removed.
 *
 * @since 2.28.0 Moved here to discourage future use
 * @since 2.12.0
 */
class CheckboxGroup extends Field
{
    use Concerns\HasEmailTag;
    use Concerns\HasHelpText;
    use Concerns\HasLabel;
    use Concerns\HasOptions;
    use Concerns\HasPlaceholder;

    const TYPE = 'legacy-checkbox-group';

    /**
     * Helper for marking the checkbox as checked by default
     *
     * @since 2.12.0
     *
     * @param bool|callable $isChecked
     *
     * @return $this
     */
    public function checked($isChecked = true)
    {
        $default = is_callable($isChecked) ? $isChecked() : $isChecked;
        $this->defaultValue((bool)$default);

        return $this;
    }

    /**
     * Returns whether the checkbox is checked by default
     *
     * @since 2.12.0
     *
     * @return bool
     */
    public function isChecked()
    {
        return (bool)$this->defaultValue;
    }
}

```
