Skip to content

Commit 59f3798

Browse files
authored
fix(field): Return null if palette slug is invalid (#42)
1 parent 84d1e10 commit 59f3798

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-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.2
7+
* Version: 1.1.3
88
* Author: Brandon Nifong
99
* Author URI: https://github.com/log1x
1010
*/

src/Field.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ protected function palette($color = null)
7070
]);
7171
}
7272

73-
return ! empty($color) ? $colors[$color] : $colors;
73+
return ! empty($color) ? (
74+
$colors[$color] ?? null
75+
) : $colors;
7476
}
7577

7678
/**

0 commit comments

Comments
 (0)