PHPackages                             getolympus/olympus-dionysos-field-checkbox - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. getolympus/olympus-dionysos-field-checkbox

ActiveOlympus-field[Framework](/categories/framework)

getolympus/olympus-dionysos-field-checkbox
==========================================

Checkbox field, this component is a part of the Olympus Dionysos fields.

v0.0.1(2y ago)03MITLess

Since Dec 18Pushed 2y ago1 watchersCompare

[ Source](https://github.com/GetOlympus/olympus-dionysos-field-checkbox)[ Packagist](https://packagist.org/packages/getolympus/olympus-dionysos-field-checkbox)[ Docs](https://github.com/GetOlympus/olympus-dionysos-field-checkbox)[ RSS](/packages/getolympus-olympus-dionysos-field-checkbox/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Dionysos Checkbox Field
=======================

[](#dionysos-checkbox-field)

> This component is a part of the **Olympus Dionysos fields** for **WordPress**.

```
composer require getolympus/olympus-dionysos-field-checkbox
```

---

[![Olympus Component](https://camo.githubusercontent.com/f483886a465a9e44005a352c6c1ba6556689a579ecf0d8b984cf60becaaa878c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f722d4f6c796d7075732d3434636331312e7376673f7374796c653d666c61742d737175617265)](https://github.com/GetOlympus)[![CodeFactor Grade](https://camo.githubusercontent.com/ee358e2926f6ee8860627db786d8df4fb49549981dc77c3497df4e60e4ccc982/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f4765744f6c796d7075732f6f6c796d7075732d64696f6e79736f732d6669656c642d636865636b626f782f62616467653f7374796c653d666c61742d737175617265)](https://www.codefactor.io/repository/github/getolympus/olympus-dionysos-field-checkbox)[![Packagist Version](https://camo.githubusercontent.com/b29e717edcff51e74ce6c159e2f9c1053307223fa0d3cc707de628ee090e04dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6765746f6c796d7075732f6f6c796d7075732d64696f6e79736f732d6669656c642d636865636b626f782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getolympus/olympus-dionysos-field-checkbox)[![MIT](https://camo.githubusercontent.com/68035de4b7f69ada20e98e34172f47d361b83a017c8045200fc338660c467897/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49545f4c6963656e73652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/GetOlympus/olympus-dionysos-field-checkbox/blob/master/LICENSE)

---

 [![](https://github.com/GetOlympus/olympus-dionysos-field-checkbox/raw/main/assets/field-checkbox-64.png)](https://github.com/GetOlympus/olympus-dionysos-field-checkbox/blob/main/assets/field-checkbox-64.png)

---

Field initialization
--------------------

[](#field-initialization)

Use the following lines to add a `checkbox field` in your **WordPress** admin pages or custom post type meta fields:

```
return \GetOlympus\Dionysos\Field\Checkbox::build('my_checkbox_field_id', [
    'title'       => 'What are your preferred personas?',
    'default'     => ['minions', 'lapinscretins'],
    'description' => 'The White House needs your feedback asap!',
    'mode'        => 'default',
    'options'     => [
        'minions'       => 'The Minions',
        'lapinscretins' => 'The Lapins Crétins',
        'marvel'        => 'All Marvel Superheroes',
        'franklin'      => 'Franklin (everything is possible)',
        'spongebob'     => 'Spongebob (nothing to say... Love it!)',
    ],

    /**
     * Texts definition
     * @see the `Texts definition` section below
     */
    't_no_options' => 'The field does no have any options.',
]);
```

Variables definition
--------------------

[](#variables-definition)

The field display depends on `mode` value:

- set to `default` (or `inline`), labels options will be displayed on the same line, as an `inline-block` display
- set to `block`, labels options will be displayed each per line, as a `block` display
- set to `image`, labels options will be displayed as `default` mode, with images and overlay text label
- set to `image-block`, labels options will be displayed as `block` mode, with images and overlay text label
- set to `group`, labels options will be displayed as a simple but efficient group of choices

### In all cases

[](#in-all-cases)

VariableTypeDefault value if not setAccepted values`title`String`'Checkbox button'`*empty*`default`Array*empty array*Array with options keys`description`String*empty**empty*`mode`String`default`see [Variables definition](#variables-definition)`options`Array*empty*Array with a key/value optionsTexts definition
----------------

[](#texts-definition)

CodeDefault valueDefinition`t_no_options`The field does no have any options.Used as an error in the case no options have been setRetrive data
------------

[](#retrive-data)

Retrieve your value from Database with a simple `get_option('my_checkbox_field_id', [])` (see [WordPress reference](https://developer.wordpress.org/reference/functions/get_option/)):

```
// Get checkbox from Database
$checkbox = get_option('my_checkbox_field_id', []);

if (!empty($checkbox)) {
    echo 'And the nominees are:';
    echo '';

    foreach ($checkbox as $value) {
        echo ''.$value.''; // Will display key item options!
    }

    echo '';
}
```

Image mode
----------

[](#image-mode)

To display images instead of simple labels, set the `mode` to `image` and build the field's options as follow:

```
$options = [
    'key-name' => [
        'label' => 'Label item',
        'image' => 'https://label-image-url',
    ],
];
```

Below, a full example:

```
return \GetOlympus\Dionysos\Field\Checkbox::build('my_checkbox_field_id', [
    'title'       => 'Select a Minion that you may know',
    'default'     => 'dave',
    'description' => 'A very important question! Pay attention to it ;)',
    'mode'        => 'image',
    'options'     => [
        'kevin' => [
            'label' => 'Kevin',
            'image' => 'https://vignette.wikia.nocookie.net/despicableme/images/1/1d/Kevin_minions.png/revision/latest/scale-to-width-down/350?cb=20170703052012',
        ],
        'mel'   => [
            'label' => 'Mel',
            'image' => 'https://vignette.wikia.nocookie.net/despicableme/images/2/2e/Mel_Minion_01.png/revision/latest/scale-to-width-down/350?cb=20160717135212',
        ],
        'dave'  => [
            'label' => 'Dave',
            'image' => 'https://vignette.wikia.nocookie.net/despicableme/images/7/71/Daveholdingcupcake.png/revision/latest/scale-to-width-down/350?cb=20130717145735',
        ],
        'bob'   => [
            'label' => 'Bob',
            'image' => 'https://vignette.wikia.nocookie.net/despicableme/images/c/ca/Bob-from-the-minions-movie.jpg/revision/latest/scale-to-width-down/350?cb=20151224154354',
        ],
    ],

    /**
     * Texts definitions
     * @see the `Texts definitions` section below
     */
    't_no_options' => 'The field does no have any options.',
]);
```

Release History
---------------

[](#release-history)

0.0.1

- Initial commit

Contributing
------------

[](#contributing)

1. Fork it ()
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

---

**Built with ♥ by [Achraf Chouk](https://github.com/crewstyle "Achraf Chouk") ~ (c) since a long time.**

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

930d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1572149?v=4)[Achraf Chouk](/maintainers/crewstyle)[@crewstyle](https://github.com/crewstyle)

---

Top Contributors

[![crewstyle](https://avatars.githubusercontent.com/u/1572149?v=4)](https://github.com/crewstyle "crewstyle (1 commits)")

---

Tags

phpframeworkwordpressfieldcheckboxcustomolympusdionysos

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/getolympus-olympus-dionysos-field-checkbox/health.svg)

```
[![Health](https://phpackages.com/badges/getolympus-olympus-dionysos-field-checkbox/health.svg)](https://phpackages.com/packages/getolympus-olympus-dionysos-field-checkbox)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
