Skip to content

Commit

Permalink
enhance(field): Add message when palette has no available colors (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Nov 8, 2022
1 parent a7a069d commit 8037afc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ public function render_field($field)
});
}

if (empty($palette)) {
echo __('There are no colors available.', 'acf-editor-palette');
return;
}

$active = is_array($field['value']) ? $field['value']['slug'] : $field['value'];

echo sprintf(
Expand Down

0 comments on commit 8037afc

Please sign in to comment.