Download the PHP package getolympus/olympus-dionysos-field-background without Composer
On this page you can find all versions of the php package getolympus/olympus-dionysos-field-background. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getolympus/olympus-dionysos-field-background
More information about getolympus/olympus-dionysos-field-background
Files in getolympus/olympus-dionysos-field-background
Package olympus-dionysos-field-background
Short Description Background field, this component is a part of the Olympus Dionysos fields.
License MIT
Homepage https://github.com/GetOlympus/olympus-dionysos-field-background
Informations about the package olympus-dionysos-field-background
Dionysos Background Field
This component is a part of the Olympus Dionysos fields for WordPress.
It useswpColor
andwpMedia
WordPress javascript bundle to manage field.
Field initialization
Use the following lines to add an background field
in your WordPress admin pages or custom post type meta fields:
Variables definition
Variable | Type | Default value if not set | Accepted values |
---|---|---|---|
title |
String | 'Background' |
empty |
can_upload |
Boolean | false |
true or false |
default |
Array | empty | empty |
description |
String | empty | empty |
settings |
Array | [] |
see Settings definition |
size |
String | 'thumbnail' |
image sizes from add_image_size() WordPress function |
Notes:
can_upload
value is defined thanks tocurrent_user_can('upload_files')
(see WordPress reference)
Settings definition
The settings
variable is an array of options defined below:
Variable | Type | Default value if not set | Accepted values |
---|---|---|---|
upload |
Boolean | true |
true or false |
color |
Array | [] |
see WordPress reference |
upload |
Array | [] |
see WordPress reference |
Retrive data
Retrieve your value from Database with a simple get_option('my_background_field_id', [])
(see WordPress reference).
Below, a json_encode()
example to understand how data are stored in Database:
And below, a simple example to show how to iterate on the data array in PHP
:
Release History
0.0.3
- Add height and width
0.0.2
- Add display
- Add JS integration
0.0.1
- Initial commit
Contributing
- Fork it (https://github.com/GetOlympus/olympus-dionysos-field-background/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.