<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
getolympus / olympus-dionysos-field-color example snippets
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',
],
]);
// 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>';
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.