Skip to content

Commit

Permalink
Revert "Calendar Settings: Separate groupings for Post Statuses, Revi…
Browse files Browse the repository at this point in the history
…sion Statuses"

This reverts commit d586f54.
  • Loading branch information
agapetry committed Jan 29, 2025
1 parent d586f54 commit d7b7a62
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions modules/calendar/library/calendar-methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ public function settings_show_posts_publish_time_option()

$field_name = esc_attr($this->module->options_group_name) . '[show_posts_publish_time]';

$customStatuses = \PublishPress_Statuses::getCustomStatuses(['for_revision' => false], 'object');

$revisionStatuses = (defined('PUBLISHPRESS_STATUSES_PRO_VERSION'))
? \PublishPress_Statuses::getCustomStatuses(['for_revision' => true], 'object')
: [];
$customStatuses = $publishpress->getCustomStatuses();

if (empty($customStatuses)) {
$statuses = [
Expand All @@ -203,11 +199,7 @@ public function settings_show_posts_publish_time_option()
$statuses = [];

foreach ($customStatuses as $status) {
$statuses[$status->slug] = ['title' => $status->label, 'status_obj' => $status, 'for_revision' => false];
}

foreach ($revisionStatuses as $status) {
$statuses[$status->slug] = ['title' => $status->label, 'status_obj' => $status, 'for_revision' => true];
$statuses[$status->slug] = ['title' => $status->label, 'status_obj' => $status];
}
}

Expand Down Expand Up @@ -249,14 +241,7 @@ public function settings_show_posts_publish_time_option()
foreach ($statuses as $status => $arr_status) {
$id = esc_attr($status) . '-display-publish-time';

if ($arr_status['for_revision'] && empty($in_revisions_section)) {
$style = 'margin-top: 30px;';
$in_revisions_section = true;
} else {
$style = '';
}

echo '<div style="' . esc_attr($style) . '"><label for="' . $id . '">';
echo '<div><label for="' . $id . '">';
echo '<input id="' . $id . '" name="' . $field_name . '[' . esc_attr($status) . ']"';

if (isset($this->module->options->show_posts_publish_time[$status])) {
Expand Down

0 comments on commit d7b7a62

Please sign in to comment.