From 0e5b8788eb7ca17c044f0e2569f8979c2348c6ff Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Thu, 29 Aug 2024 16:57:45 -0400 Subject: [PATCH] Block binding: Add value for displaying short contribution details --- themes/wporg-5ftf-2024/inc/block-bindings.php | 6 ++++++ themes/wporg-5ftf-2024/patterns/archive-5ftf-pledge.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/themes/wporg-5ftf-2024/inc/block-bindings.php b/themes/wporg-5ftf-2024/inc/block-bindings.php index ce8256f..5f728f6 100644 --- a/themes/wporg-5ftf-2024/inc/block-bindings.php +++ b/themes/wporg-5ftf-2024/inc/block-bindings.php @@ -59,5 +59,11 @@ function get_meta_binding_value( $args, $block ) { number_format_i18n( absint( $contribution_data['hours'] ) ), count( $contribution_data['teams'] ) ); + case 'org-contribution-short-details': + $contribution_data = get_aggregate_contributor_data_for_pledge( $block->context['postId'] ); + return sprintf( + __( 'Has pledged %s hours per week.', 'wporg-5ftf' ), + number_format_i18n( absint( $contribution_data['hours'] ) ), + ); } } diff --git a/themes/wporg-5ftf-2024/patterns/archive-5ftf-pledge.php b/themes/wporg-5ftf-2024/patterns/archive-5ftf-pledge.php index 8329f03..b5445a1 100644 --- a/themes/wporg-5ftf-2024/patterns/archive-5ftf-pledge.php +++ b/themes/wporg-5ftf-2024/patterns/archive-5ftf-pledge.php @@ -65,8 +65,8 @@ if ( is_search() ) {
- -

Has pledged…

+ +