Download the PHP package getolympus/olympus-dionysos-field-checkbox without Composer
On this page you can find all versions of the php package getolympus/olympus-dionysos-field-checkbox. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getolympus/olympus-dionysos-field-checkbox
More information about getolympus/olympus-dionysos-field-checkbox
Files in getolympus/olympus-dionysos-field-checkbox
Package olympus-dionysos-field-checkbox
Short Description Checkbox field, this component is a part of the Olympus Dionysos fields.
License MIT
Homepage https://github.com/GetOlympus/olympus-dionysos-field-checkbox
Informations about the package olympus-dionysos-field-checkbox
Dionysos Checkbox Field
This component is a part of the Olympus Dionysos fields for WordPress.
Field initialization
Use the following lines to add a checkbox field
in your WordPress admin pages or custom post type meta fields:
Variables definition
The field display depends on mode
value:
- set to
default
(orinline
), labels options will be displayed on the same line, as aninline-block
display - set to
block
, labels options will be displayed each per line, as ablock
display - set to
image
, labels options will be displayed asdefault
mode, with images and overlay text label - set to
image-block
, labels options will be displayed asblock
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
Variable | Type | Default value if not set | Accepted values |
---|---|---|---|
title |
String | 'Checkbox button' |
empty |
default |
Array | empty array | Array with options keys |
description |
String | empty | empty |
mode |
String | default |
see Variables definition |
options |
Array | empty | Array with a key/value options |
Texts definition
Code | Default value | Definition |
---|---|---|
t_no_options |
The field does no have any options. | Used as an error in the case no options have been set |
Retrive data
Retrieve your value from Database with a simple get_option('my_checkbox_field_id', [])
(see WordPress reference):
Image mode
To display images instead of simple labels, set the mode
to image
and build the field's options as follow:
Below, a full example:
Release History
0.0.1
- Initial commit
Contributing
- Fork it (https://github.com/GetOlympus/olympus-dionysos-field-checkbox/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Built with ♥ by Achraf Chouk ~ (c) since a long time.