Skip to content

Commit 8037afc

Browse files
authored
enhance(field): Add message when palette has no available colors (#47)
1 parent a7a069d commit 8037afc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Field.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public function render_field($field)
6262
});
6363
}
6464

65+
if (empty($palette)) {
66+
echo __('There are no colors available.', 'acf-editor-palette');
67+
return;
68+
}
69+
6570
$active = is_array($field['value']) ? $field['value']['slug'] : $field['value'];
6671

6772
echo sprintf(

0 commit comments

Comments
 (0)