Skip to content

Commit

Permalink
Call PublishPress_Statuses for default icon color, status edit link
Browse files Browse the repository at this point in the history
  • Loading branch information
agapetry committed Nov 18, 2023
1 parent 8476d50 commit 462ffaf
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1717,9 +1717,10 @@ protected function get_post_status_options($post_status)
}

// Color
$color = PP_Custom_Status::DEFAULT_COLOR;
if (! empty($term->color)) {
$color = $term->color;
} else {
$color = (class_exists('PublishPress_Statuses')) ? \PublishPress_Statuses::DEFAULT_COLOR : '#78645a';
}

return [
Expand Down Expand Up @@ -2787,24 +2788,22 @@ public function settings_show_posts_publish_time_option()
. '</span>'
. '</label>';

$_args = [
'action' => 'edit-status',
'return_module' => 'pp-calendar-settings',
];

if (class_exists('PublishPress_Statuses')) {
$_args = [
'action' => 'edit-status',
'return_module' => 'pp-calendar-settings',
];

$_args['name'] = $arr_status['status_obj']->name;
} else {
$_args['term-id'] = $arr_status['status_obj']->term_id;
}

$item_edit_link = esc_url(
PP_Custom_Status::get_link(
$_args
)
);

echo ' <a href="' . $item_edit_link . '">' . __('edit') . '</a>';
$item_edit_link = esc_url(
PublishPress_Statuses::get_link(
$_args
)
);

echo ' <a href="' . $item_edit_link . '">' . __('edit') . '</a>';
}

echo '</div>';
}
Expand Down

0 comments on commit 462ffaf

Please sign in to comment.