From e1e5c22654798f7164ebf2da5fedac55d3254c75 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Thu, 24 Oct 2019 16:45:57 -0400 Subject: [PATCH] Add real contributors to the pledges --- .../template-parts/content-5ftf_pledge.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/themes/wporg-5ftf/template-parts/content-5ftf_pledge.php b/themes/wporg-5ftf/template-parts/content-5ftf_pledge.php index e2a89d5..60daf12 100644 --- a/themes/wporg-5ftf/template-parts/content-5ftf_pledge.php +++ b/themes/wporg-5ftf/template-parts/content-5ftf_pledge.php @@ -5,6 +5,7 @@ namespace WordPressdotorg\Five_for_the_Future\Theme; +use WordPressDotOrg\FiveForTheFuture\Contributor; use WordPressDotOrg\FiveForTheFuture\PledgeMeta; $data = array(); @@ -13,8 +14,7 @@ foreach ( PledgeMeta\get_pledge_meta_config() as $key => $config ) { $data[ $key ] = get_post_meta( get_the_ID(), PledgeMeta\META_PREFIX . $key, $config['single'] ); } -// @todo Get real contributors from the post. -$contributors = array(); +$contributors = Contributor\get_pledge_contributors( get_the_ID() ); $count = count( $contributors ); $content = apply_filters( 'the_content', $data['org-description'] ); @@ -60,11 +60,17 @@ $contributor_title = sprintf(

- - - - - + post_title ); + if ( $contrib ) { + printf( + '%s', + get_avatar( $contrib->user_email, 30, 'blank' ) + ); + } + } + ?>