log1x / acf-editor-palette
A replica Gutenberg color picker field for Advanced Custom Fields.
Fund package maintenance!
log1x
Installs: 164 089
Dependents: 0
Suggesters: 0
Security: 0
Stars: 95
Watchers: 9
Forks: 14
Open Issues: 7
Type:wordpress-plugin
Requires
- php: >=7.2
Requires (Dev)
- squizlabs/php_codesniffer: ^3.10
This package is auto-updated.
Last update: 2024-10-24 15:21:54 UTC
README
A Gutenberg-like editor palette color picker field for Advanced Custom Fields.
Features
- Colors are automatically loaded from
theme.json
and/or the editor palette. - Return format includes the default palette keys as well as background and text color classes for convenience.
- Default value can optionally be set using the color's slug.
- Colors can optionally be allowed/excluded from the palette.
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
^ 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.