Skip to content

Commit

Permalink
Content Calendar: Restore default colors if PP Statuses not activated
Browse files Browse the repository at this point in the history
  • Loading branch information
agapetry committed Jan 4, 2024
1 parent a311784 commit fcbf0a2
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,20 @@ protected function get_post_status_options($post_status)
if (! empty($term->color)) {
$color = $term->color;
} else {
$color = (class_exists('PublishPress_Statuses')) ? \PublishPress_Statuses::DEFAULT_COLOR : '#78645a';
$default_status_colors = [
'pitch' => '#cc0000',
'assigned' => '#00bcc5',
'in-progress' => '#ccc500',
'draft' => '#f91d84',
'pending' => '#d87200',
'private' => '#000000',
];

if (isset($default_status_colors[$post_status])) {
$color = $default_status_colors[$post_status];
} else {
$color = (class_exists('PublishPress_Statuses')) ? \PublishPress_Statuses::DEFAULT_COLOR : '#78645a';
}
}

return [
Expand Down

0 comments on commit fcbf0a2

Please sign in to comment.