Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update/#1741-Remove-the-Editorial-Fields-from-the-filters-if-empty #1752

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading