2017 © Pedro Peláez
 

olympus-field olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Zeus Core framework.

image

getolympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Zeus Core framework.

  • Saturday, March 17, 2018
  • by crewstyle
  • Repository
  • 1 Watchers
  • 0 Stars
  • 176 Installations
  • JavaScript
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Dionysos Color Field

This component is a part of the Olympus Dionysos fields for WordPress.
It uses the default WordPress color field., (*1)

composer require getolympus/olympus-dionysos-field-color

Olympus Component ![CodeFactor Grade][codefactor-image] Packagist Version ![MIT][license-image], (*2)


, (*3)


Field initialization

Use the following lines to add a color field in your WordPress admin pages or custom post type meta fields:, (*4)

return \GetOlympus\Dionysos\Field\Color::build('my_color_field_id', [
    'title'       => 'What is your favorite Coke?',
    'default'     => '#f40000',
    'description' => 'Zero and Light are not available colors!',

    /**
     * Color picker settings
     * @see https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/color-picker.js
     */
    'settings' => [
        'defaultColor' => false,
        'hide'         => true,
        'palettes'     => true,
        'width'        => 255,
        'mode'         => 'hsv',
        'type'         => 'full',
        'slider'       => 'horizontal',
    ],
]);

Variables definitions

Variable Type Default value if not set Accepted values
title String 'Color' empty
default String empty Hex color code
description String empty empty
settings Array see Field initialization see WordPress reference

Retrive data

Retrieve your value from Database with a simple get_option('my_color_field_id', '') (see WordPress reference)., (*5)

// Get color from Database
$color = get_option('my_color_field_id', '#f40000');

// Display Coca-Cola baseline in color
echo 'Always <b style="color:'.$color.'">Coca-Cola</b>';

Release History

0.0.13 - Use default getVars Zeus-Core method. No need to override it anymore, (*6)

0.0.12 - New Olympus components compatibility - Change repository to be a part of Dionysos fields, (*7)

0.0.11 - FIX: json encoder in twig source file, (*8)

Contributing

  1. Fork it (https://github.com/GetOlympus/olympus-dionysos-field-color/fork)
  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 ~ (c) since a long time., (*9)

The Versions

17/03 2018

dev-master

9999999-dev https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus zeus hera

17/03 2018

v0.0.6

0.0.6.0 https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus zeus

08/10 2016

v0.0.5

0.0.5.0 https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus hera

26/06 2016

v0.0.4

0.0.4.0 https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus hera

10/05 2016

v0.0.3

0.0.3.0 https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus hera

05/05 2016

v0.0.2

0.0.2.0 https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus hera

29/04 2016

v0.0.1

0.0.1.0 https://github.com/GetOlympus/olympus-color-field

[READ-ONLY] Color field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field color olympus hera