From 9f2b25ce1a68620c6902bbbc65e3e140c5836a91 Mon Sep 17 00:00:00 2001 From: Chris Abraham Date: Wed, 2 Apr 2025 08:44:51 +0700 Subject: [PATCH] Add Golden Kubestronaut capability (#909) * Add Golden Kubestronaut capability Signed-off-by: Chris Abraham * darken the golden marker slightly Signed-off-by: Chris Abraham * store golden designation in meta Signed-off-by: Chris Abraham * improve styling Signed-off-by: Chris Abraham * sync Signed-off-by: Chris Abraham * no sync Signed-off-by: Chris Abraham * fix url Signed-off-by: Chris Abraham * hide people again Signed-off-by: Chris Abraham * temporarily sync people on page load Signed-off-by: Chris Abraham * undo temporary sync Signed-off-by: Chris Abraham --------- Signed-off-by: Chris Abraham --- .../wp-mu-plugins/lf-mu/admin/partials/sync-people.php | 7 +++++++ .../themes/cncf-twenty-two/components/people-item.php | 9 +++++++-- .../images/map-markers/person-golden.svg | 1 + .../cncf-twenty-two/includes/shortcodes/people-map.php | 7 +++++++ .../cncf-twenty-two/source/js/on-demand/people-map.js | 8 +++++++- .../source/scss/components/_people.scss | 10 +++++++++- 6 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 web/wp-content/themes/cncf-twenty-two/images/map-markers/person-golden.svg diff --git a/web/wp-content/mu-plugins/wp-mu-plugins/lf-mu/admin/partials/sync-people.php b/web/wp-content/mu-plugins/wp-mu-plugins/lf-mu/admin/partials/sync-people.php index 7b331673..2225c98e 100644 --- a/web/wp-content/mu-plugins/wp-mu-plugins/lf-mu/admin/partials/sync-people.php +++ b/web/wp-content/mu-plugins/wp-mu-plugins/lf-mu/admin/partials/sync-people.php @@ -189,6 +189,13 @@ foreach ( $people as $p ) { } if ( property_exists( $p, 'category' ) ) { wp_set_object_terms( $newid, $p->category, 'lf-person-category', false ); + + // if category contains element "Golden-Kubestronaut", then set meta field "lf_person_golden" to true. + if ( in_array( 'Golden-Kubestronaut', $p->category, true ) ) { + update_post_meta( $newid, 'lf_person_golden', true ); + } else { + update_post_meta( $newid, 'lf_person_golden', false ); + } } else { wp_set_object_terms( $newid, array(), 'lf-person-category', false ); } diff --git a/web/wp-content/themes/cncf-twenty-two/components/people-item.php b/web/wp-content/themes/cncf-twenty-two/components/people-item.php index 42d19930..4c0c412c 100644 --- a/web/wp-content/themes/cncf-twenty-two/components/people-item.php +++ b/web/wp-content/themes/cncf-twenty-two/components/people-item.php @@ -38,8 +38,13 @@ $current_url = home_url( 'people/ambassadors' ); $show_modal = isset( $args['show_profile'] ) && $args['show_profile'] ? true : false; $show_logos = isset( $args['show_logos'] ) && $args['show_logos'] ? true : false; + +$extra_classes = ''; +if ( has_term( 'golden-kubestronaut', 'lf-person-category' ) ) { + $extra_classes = 'golden-kubestronaut'; +} ?> -
+