Skip to content

Commit

Permalink
Merge pull request #1752 from publishpress/update/#1741-Remove-the-Ed…
Browse files Browse the repository at this point in the history
…itorial-Fields-from-the-filters-if-empty

update/#1741-Remove-the-Editorial-Fields-from-the-filters-if-empty
  • Loading branch information
olatechpro authored Sep 3, 2024
2 parents 87fbb00 + 741c2ef commit c1c07d3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 3 additions & 2 deletions modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2106,8 +2106,9 @@ public function content_calendar_customize_filter_form() {
$filter_index = 0;
foreach ($filters as $filter_group => $filter_datas) :
$filter_index++;
$hidden_style = empty($filter_datas['filters']) ? 'display: none;' : '';
?>
<div class="customize-group-title title-index-<?php echo esc_attr($filter_index); ?> <?php echo esc_attr($filter_group); ?>">
<div class="customize-group-title title-index-<?php echo esc_attr($filter_index); ?> <?php echo esc_attr($filter_group); ?>" style="<?php echo esc_attr($hidden_style); ?>">
<div class="title-text"><?php echo esc_html($filter_datas['title']); ?></div>
<?php if ($filter_group === 'custom') : ?>
<div class="title-action new-item">
Expand Down Expand Up @@ -2136,7 +2137,7 @@ public function content_calendar_customize_filter_form() {
</div>
<?php endif; ?>
<?php if (empty($filter_datas['filters'])) : ?>
<div class="item-group-empty <?php echo esc_attr($filter_group); ?>"><?php echo esc_html($filter_datas['message']); ?></div>
<div class="item-group-empty <?php echo esc_attr($filter_group); ?>" style="<?php echo esc_attr($hidden_style); ?>"><?php echo esc_html($filter_datas['message']); ?></div>
<?php else : ?>
<?php foreach ($filter_datas['filters'] as $filter_name => $filter_label) :
$active_class = (in_array($filter_name, $enabled_filters)) ? 'active-item' : '';
Expand Down
10 changes: 6 additions & 4 deletions modules/content-board/content-board.php
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,9 @@ public function content_board_customize_column_form() {
$column_index = 0;
foreach ($columns as $column_group => $column_datas) :
$column_index++;
$hidden_style = empty($column_datas['columns']) ? 'display: none;' : '';
?>
<div class="customize-group-title title-index-<?php echo esc_attr($column_index); ?> <?php echo esc_attr($column_group); ?>">
<div class="customize-group-title title-index-<?php echo esc_attr($column_index); ?> <?php echo esc_attr($column_group); ?>" style="<?php echo esc_attr($hidden_style); ?>">
<div class="title-text"><?php echo esc_html($column_datas['title']); ?></div>
<?php if ($column_group === 'custom') : ?>
<div class="title-action new-item">
Expand Down Expand Up @@ -1232,7 +1233,7 @@ public function content_board_customize_column_form() {
</div>
<?php endif; ?>
<?php if (empty($column_datas['columns'])) : ?>
<div class="item-group-empty <?php echo esc_attr($column_group); ?>"><?php echo esc_html($column_datas['message']); ?></div>
<div class="item-group-empty <?php echo esc_attr($column_group); ?>" style="<?php echo esc_attr($hidden_style); ?>"><?php echo esc_html($column_datas['message']); ?></div>
<?php else : ?>
<?php foreach ($column_datas['columns'] as $column_name => $column_label) :
$active_class = (in_array($column_name, $enabled_columns)) ? 'active-item' : '';
Expand Down Expand Up @@ -1350,8 +1351,9 @@ public function content_board_customize_filter_form() {
$filter_index = 0;
foreach ($filters as $filter_group => $filter_datas) :
$filter_index++;
$hidden_style = empty($filter_datas['filters']) ? 'display: none;' : '';
?>
<div class="customize-group-title title-index-<?php echo esc_attr($filter_index); ?> <?php echo esc_attr($filter_group); ?>">
<div class="customize-group-title title-index-<?php echo esc_attr($filter_index); ?> <?php echo esc_attr($filter_group); ?>" style="<?php echo esc_attr($hidden_style); ?>">
<div class="title-text"><?php echo esc_html($filter_datas['title']); ?></div>
<?php if ($filter_group === 'custom') : ?>
<div class="title-action new-item">
Expand Down Expand Up @@ -1380,7 +1382,7 @@ public function content_board_customize_filter_form() {
</div>
<?php endif; ?>
<?php if (empty($filter_datas['filters'])) : ?>
<div class="item-group-empty <?php echo esc_attr($filter_group); ?>"><?php echo esc_html($filter_datas['message']); ?></div>
<div class="item-group-empty <?php echo esc_attr($filter_group); ?>" style="<?php echo esc_attr($hidden_style); ?>"><?php echo esc_html($filter_datas['message']); ?></div>
<?php else : ?>
<?php foreach ($filter_datas['filters'] as $filter_name => $filter_label) :
$active_class = (in_array($filter_name, $enabled_filters)) ? 'active-item' : '';
Expand Down
10 changes: 6 additions & 4 deletions modules/content-overview/content-overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -1227,8 +1227,9 @@ public function content_overview_customize_column_form() {
$column_index = 0;
foreach ($columns as $column_group => $column_datas) :
$column_index++;
$hidden_style = empty($column_datas['columns']) ? 'display: none;' : '';
?>
<div class="customize-group-title title-index-<?php echo esc_attr($column_index); ?> <?php echo esc_attr($column_group); ?>">
<div class="customize-group-title title-index-<?php echo esc_attr($column_index); ?> <?php echo esc_attr($column_group); ?>" style="<?php echo esc_attr($hidden_style); ?>">
<div class="title-text"><?php echo esc_html($column_datas['title']); ?></div>
<?php if ($column_group === 'custom') : ?>
<div class="title-action new-item">
Expand Down Expand Up @@ -1257,7 +1258,7 @@ public function content_overview_customize_column_form() {
</div>
<?php endif; ?>
<?php if (empty($column_datas['columns'])) : ?>
<div class="item-group-empty <?php echo esc_attr($column_group); ?>"><?php echo esc_html($column_datas['message']); ?></div>
<div class="item-group-empty <?php echo esc_attr($column_group); ?>" style="<?php echo esc_attr($hidden_style); ?>"><?php echo esc_html($column_datas['message']); ?></div>
<?php else : ?>
<?php foreach ($column_datas['columns'] as $column_name => $column_label) :
$active_class = (in_array($column_name, $enabled_columns)) ? 'active-item' : '';
Expand Down Expand Up @@ -1375,8 +1376,9 @@ public function content_overview_customize_filter_form() {
$filter_index = 0;
foreach ($filters as $filter_group => $filter_datas) :
$filter_index++;
$hidden_style = empty($filter_datas['filters']) ? 'display: none;' : '';
?>
<div class="customize-group-title title-index-<?php echo esc_attr($filter_index); ?> <?php echo esc_attr($filter_group); ?>">
<div class="customize-group-title title-index-<?php echo esc_attr($filter_index); ?> <?php echo esc_attr($filter_group); ?>" style="<?php echo esc_attr($hidden_style); ?>">
<div class="title-text"><?php echo esc_html($filter_datas['title']); ?></div>
<?php if ($filter_group === 'custom') : ?>
<div class="title-action new-item">
Expand Down Expand Up @@ -1405,7 +1407,7 @@ public function content_overview_customize_filter_form() {
</div>
<?php endif; ?>
<?php if (empty($filter_datas['filters'])) : ?>
<div class="item-group-empty <?php echo esc_attr($filter_group); ?>"><?php echo esc_html($filter_datas['message']); ?></div>
<div class="item-group-empty <?php echo esc_attr($filter_group); ?>" style="<?php echo esc_attr($hidden_style); ?>"><?php echo esc_html($filter_datas['message']); ?></div>
<?php else : ?>
<?php foreach ($filter_datas['filters'] as $filter_name => $filter_label) :
$active_class = (in_array($filter_name, $enabled_filters)) ? 'active-item' : '';
Expand Down

0 comments on commit c1c07d3

Please sign in to comment.