Skip to content

Commit

Permalink
Color fields expect values to be lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Nov 11, 2024
1 parent 62558ef commit 4a30df9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/acfadapters/ColorPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function create(array $data): FieldInterface
{
$field = new Color();
if ($data['default_value']) {
$field->defaultColor = $data['default_value'];
$field->defaultColor = strtolower($data['default_value']);
}
return $field;
}
Expand Down
2 changes: 1 addition & 1 deletion src/generators/fields/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected static function create(): FieldInterface
$presets = [];
foreach ($command->wpInfo['color_palette'] as $palette) {
foreach ($palette as $paletteColor) {
$presets[$paletteColor['color']] = true;
$presets[strtolower($paletteColor['color'])] = true;
}
}
$field->presets = array_keys($presets);
Expand Down

0 comments on commit 4a30df9

Please sign in to comment.