From 81f34cd6104d60f73e14aaaa366504789c507b71 Mon Sep 17 00:00:00 2001 From: Szymon Kasprzyk Date: Tue, 1 Aug 2023 12:04:01 +0200 Subject: [PATCH 1/2] updates CH query to include primary position for people profiles --- wp-content/plugins/vf-group-header-block/template.php | 4 +++- wp-content/plugins/vf-members-block/template.php | 5 +++-- wp-content/plugins/vf-members-block/vf-person/template.php | 2 ++ wp-content/plugins/vf-members-internal/template.php | 4 +++- .../vf-members-internal/vf-person-internal/template.php | 2 ++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/wp-content/plugins/vf-group-header-block/template.php b/wp-content/plugins/vf-group-header-block/template.php index 24a769536..1c4d2b956 100644 --- a/wp-content/plugins/vf-group-header-block/template.php +++ b/wp-content/plugins/vf-group-header-block/template.php @@ -63,7 +63,9 @@ 'hide[team,mobile,phones]' => 1, 'sort-field-value[changed]' => 'DESC', 'filter-ref-entity[field_person_positions][title]' => "", - 'filter-field-value[field_person_positions.entity.field_position_membership]' => 'leader' + 'filter-field-value[field_person_positions.entity.field_position_membership]' => 'leader', + 'filter-ref-entity[field_person_positions][field_position_primary]' => 1 + ); if ($is_minimal) { diff --git a/wp-content/plugins/vf-members-block/template.php b/wp-content/plugins/vf-members-block/template.php index 7770baf6c..f98999ebf 100644 --- a/wp-content/plugins/vf-members-block/template.php +++ b/wp-content/plugins/vf-members-block/template.php @@ -45,7 +45,8 @@ 'sort-field-value[field_person_full_name]' => 'ASC', 'filter-fields-empty' => 'field_person_visible_internally', 'filter-ref-entity[field_person_positions][title]' => "", - 'hide[team,' . $hide_fields . ']' => 1 + 'hide[team,' . $hide_fields . ']' => 1, + 'filter-ref-entity[field_person_positions][field_position_primary]' => 1 ); if ($leader !== true) { @@ -120,7 +121,7 @@ $content = preg_replace( '#^(\s*<[^>]+?vf-content-hub-html)#', - '$1 vf-grid vf-grid__col-' . $columns, + '$1 vf-grid vf-grid__col-' . $columns . ' | vf-u-margin__bottom--800', $content ); diff --git a/wp-content/plugins/vf-members-block/vf-person/template.php b/wp-content/plugins/vf-members-block/vf-person/template.php index 249200a93..9012e0521 100644 --- a/wp-content/plugins/vf-members-block/vf-person/template.php +++ b/wp-content/plugins/vf-members-block/vf-person/template.php @@ -67,6 +67,8 @@ 'limit' => 1, 'filter-ref-entity[field_person_positions][title]' => "", 'hide[' . $hide_fields . ']' => 1, + 'filter-ref-entity[field_person_positions][field_position_primary]' => 1 + ), $url); // Add search field query var diff --git a/wp-content/plugins/vf-members-internal/template.php b/wp-content/plugins/vf-members-internal/template.php index 2fa1c638d..0bdeeb4f5 100644 --- a/wp-content/plugins/vf-members-internal/template.php +++ b/wp-content/plugins/vf-members-internal/template.php @@ -45,7 +45,9 @@ 'sort-field-value[field_person_name_last]' => 'DSC', 'filter-fields-empty' => 'field_person_visible_internally', 'filter-ref-entity[field_person_positions][title]' => "", - 'hide[team,' . $hide_fields . ']' => 1 + 'hide[team,' . $hide_fields . ']' => 1, + 'filter-ref-entity[field_person_positions][field_position_primary]' => 1 + ); if ($leader !== true) { diff --git a/wp-content/plugins/vf-members-internal/vf-person-internal/template.php b/wp-content/plugins/vf-members-internal/vf-person-internal/template.php index 3c1a077fe..37ff29cb8 100644 --- a/wp-content/plugins/vf-members-internal/vf-person-internal/template.php +++ b/wp-content/plugins/vf-members-internal/vf-person-internal/template.php @@ -67,6 +67,8 @@ 'limit' => 1, 'filter-ref-entity[field_person_positions][title]' => "", 'hide[' . $hide_fields . ']' => 1, + 'filter-ref-entity[field_person_positions][field_position_primary]' => 1 + ), $url); // Add search field query var From b4a54cb97a1eda768843ef80f563f99d8107935c Mon Sep 17 00:00:00 2001 From: Szymon Kasprzyk Date: Tue, 1 Aug 2023 12:14:51 +0200 Subject: [PATCH 2/2] updates wp query for trec events --- wp-content/themes/vf-wp-groups/template-trec-events.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/wp-content/themes/vf-wp-groups/template-trec-events.php b/wp-content/themes/vf-wp-groups/template-trec-events.php index 59ab211db..b5d813e6e 100644 --- a/wp-content/themes/vf-wp-groups/template-trec-events.php +++ b/wp-content/themes/vf-wp-groups/template-trec-events.php @@ -57,12 +57,19 @@ class="vf-search__button | vf-button vf-button--tertiary vf-button--sm"> 'orderby' => 'meta_value_num', 'meta_key' => 'vf_event_start_date', 'meta_query' => array( + 'relation' => 'OR', array( 'key' => 'vf_event_start_date', 'value' => $current_date, 'compare' => '>=', 'type' => 'numeric' ), + array( + 'key' => 'vf_event_end_date', + 'value' => $current_date, + 'compare' => '>=', + 'type' => 'numeric' + ), array( 'key' => 'vf_event_start_date', 'value' => date('Ymd', strtotime('now')), @@ -70,7 +77,7 @@ class="vf-search__button | vf-button vf-button--tertiary vf-button--sm"> 'compare' => '>=', ) ) )); - $current_month = ""; ?> + $current_month = ""; ?> have_posts()) : $forthcomingLoop->the_post();?>