Skip to content

Commit

Permalink
Merge pull request #1980 from CityOfPhiladelphia/fix-filter-tag
Browse files Browse the repository at this point in the history
Fix filter tag
  • Loading branch information
RitikaDesai98 authored Aug 31, 2023
2 parents 287c0d4 + 89c75aa commit 1c2e7c2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,7 @@ public static function phila_metabox_full_options( ){
'type' => 'group',
'fields' => array(
Phila_Gov_Standard_Metaboxes::phila_metabox_category_picker('Select new owner', 'phila_ann_category', 'Display announcements from these owners.' ),
array(
'name' => 'Filter by a tag',
'id' => 'tag',
'type' => 'taxonomy_advanced',
'taxonomy' => 'ann_tag',
'field_type' => 'select_advanced',
'desc' => 'Display announcements using this tag.'
),
Phila_Gov_Standard_Metaboxes::phila_metabox_tag_picker('Filter by a tag', 'phila_ann_tag', 'Display announcements using this tag.' ),
),
),
array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,19 @@ public static function phila_metabox_category_picker( $name, $id, $desc = ''){
);
}

public static function phila_metabox_tag_picker( $name, $id, $desc = ''){
return array(
'name' => $name,
'id' => $id,
'desc' => $desc,
'type' => 'taxonomy_advanced',
'taxonomy' => 'post_tag',
'field_type' => 'select_advanced',
'multiple' => false,
'allowClear' => true
);
}

public static function phila_call_to_action_group_content( $datalist = null ){
return array(
array(
Expand Down
17 changes: 6 additions & 11 deletions wp/wp-content/themes/phila.gov-theme/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,8 @@ function phila_is_department_homepage( $post ) {

function phila_get_current_department_name( $category, $byline = false, $break_tags = false, $name_list = false ){

if( !empty( $category ) && $category[0]->slug != 'uncategorized' ) {

if( !empty( $category ) && $category[0]->slug != 'uncategorized' ) {

$cat_name = array();
$cat_ids = array();
Expand All @@ -909,10 +910,8 @@ function phila_get_current_department_name( $category, $byline = false, $break_t

foreach( $category as $cat ){
array_push( $cat_name, $cat->name );
}
foreach( $category as $cat ){
array_push( $cat_ids, $cat->cat_ID );
}
}

$cat_id_string = implode( ', ', $cat_ids );

Expand All @@ -938,13 +937,9 @@ function phila_get_current_department_name( $category, $byline = false, $break_t

$is_in_govt_dir = rwmb_meta('phila_department_home_page');

if ( !$is_parent ) {
if ( !$is_parent || $is_in_govt_dir) {

$all_available_pages[$permalink] = $the_title;

}else if($is_in_govt_dir){

$all_available_pages[$permalink] = $the_title;
$all_available_pages[$permalink] = $the_title;

}
}
Expand All @@ -954,7 +949,7 @@ function phila_get_current_department_name( $category, $byline = false, $break_t

if ( $byline == true ) {
echo ' by ';
}
}

foreach ( $all_available_pages as $k => $v ){

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

<?php elseif ( $current_row_option === 'phila_announcements' ): ?>
<!-- Announcement Content -->
<?php $ann_cat_override = isset( $current_row['phila_full_options']['phila_announcements_group']['phila_ann_category']) ? $current_row['phila_full_options']['phila_announcements_group']['phila_ann_category'] : ''; ?>
<?php $blog_tag_override = isset( $current_row['phila_full_options']['phila_announcements_group']['ann_tag']) ? $current_row['phila_full_options']['phila_announcements_group']['ann_tag'] : ''; ?>
<?php $ann_cat_override = isset( $current_row['phila_full_options']['phila_announcements_group']['phila_ann_category']) ? $current_row['phila_full_options']['phila_announcements_group']['phila_ann_category'] : ''; ?>
<?php $ann_tag_override = isset( $current_row['phila_full_options']['phila_announcements_group']['phila_ann_tag']) ? $current_row['phila_full_options']['phila_announcements_group']['phila_ann_tag'] : ''; ?>
<?php include( locate_template( 'partials/global/phila_full_row_announcements.php' ) ); ?>
<!-- /Announcement Content -->
<?php elseif ( $current_row_option == 'phila_full_width_calendar'):
Expand Down

0 comments on commit 1c2e7c2

Please sign in to comment.