Log1x / acf-editor-palette

A Gutenberg-like editor palette color picker field for Advanced Custom Fields.
https://github.com/Log1x/acf-editor-palette
MIT License
95 stars 15 forks source link
acf-field gutenberg wordpress wordpress-plugin

ACF Editor Palette

Latest Stable Version Total Downloads Build Status

A Gutenberg-like editor palette color picker field for Advanced Custom Fields.

Field Example

Features

Requirements

Installation

Bedrock

Install via Composer:

$ composer require log1x/acf-editor-palette

Manual

Download the latest release .zip and install into wp-content/plugins.

Usage

Field Group Example

^ array:5 [▼
  "name" => "Green (500)"
  "slug" => "green-500"
  "color" => "#0e9f6e"
  "text" => "has-text-color has-green-500-color"
  "background" => "has-background has-green-500-background-color"
]

ACF Composer

If you are on Sage 10 and using my ACF Composer package:

$field
  ->addField('my_color_field', 'editor_palette')
    ->setConfig('default_value', 'green-500')
    ->setConfig('allowed_colors', ['green-500', 'blue-500'])
    ->setConfig('exclude_colors', ['green-50', 'green-100'])
    ->setConfig('return_format', 'slug');

Bug Reports

If you discover a bug in ACF Editor Palette, please open an issue.

Contributing

Contributing whether it be through PRs, reporting an issue, or suggesting an idea is encouraged and appreciated.

License

ACF Editor Palette is provided under the MIT License.