Skip to content

Commit 84d1e10

Browse files
authored
fix(field): Ensure value is not empty before parsing through palette() (#41)
1 parent 7a30258 commit 84d1e10

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin Name: Advanced Custom Fields: Editor Palette Field
55
* Plugin URI: https://github.com/log1x/acf-editor-palette
66
* Description: A Gutenberg-like editor palette color picker field for Advanced Custom Fields.
7-
* Version: 1.1.1
7+
* Version: 1.1.2
88
* Author: Brandon Nifong
99
* Author URI: https://github.com/log1x
1010
*/

src/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function format_value($value, $post_id, $field)
236236
{
237237
$format = $field['return_format'] ?? $this->defaults['return_format'];
238238

239-
if (is_string($value)) {
239+
if (! empty($value) && is_string($value)) {
240240
$value = $this->palette($value);
241241
}
242242

0 commit comments

Comments
 (0)