mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-05 10:25:45 +03:00
Add real contributors to the pledges
This commit is contained in:
parent
c11eff4522
commit
e1e5c22654
1 changed files with 13 additions and 7 deletions
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
namespace WordPressdotorg\Five_for_the_Future\Theme;
|
namespace WordPressdotorg\Five_for_the_Future\Theme;
|
||||||
|
|
||||||
|
use WordPressDotOrg\FiveForTheFuture\Contributor;
|
||||||
use WordPressDotOrg\FiveForTheFuture\PledgeMeta;
|
use WordPressDotOrg\FiveForTheFuture\PledgeMeta;
|
||||||
|
|
||||||
$data = array();
|
$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'] );
|
$data[ $key ] = get_post_meta( get_the_ID(), PledgeMeta\META_PREFIX . $key, $config['single'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo Get real contributors from the post.
|
$contributors = Contributor\get_pledge_contributors( get_the_ID() );
|
||||||
$contributors = array();
|
|
||||||
$count = count( $contributors );
|
$count = count( $contributors );
|
||||||
|
|
||||||
$content = apply_filters( 'the_content', $data['org-description'] );
|
$content = apply_filters( 'the_content', $data['org-description'] );
|
||||||
|
@ -60,11 +60,17 @@ $contributor_title = sprintf(
|
||||||
<?php /* phpcs:ignore -- escaped above */ ?>
|
<?php /* phpcs:ignore -- escaped above */ ?>
|
||||||
<h3><?php echo $contributor_title ?></h3>
|
<h3><?php echo $contributor_title ?></h3>
|
||||||
|
|
||||||
<?php foreach ( $contributors as $contrib_email ) : ?>
|
<?php
|
||||||
<span class="pledge-contributor__avatar">
|
foreach ( $contributors as $contrib_post ) {
|
||||||
<?php echo get_avatar( $contrib_email, 30, 'blank' ); ?>
|
$contrib = get_user_by( 'login', $contrib_post->post_title );
|
||||||
</span>
|
if ( $contrib ) {
|
||||||
<?php endforeach; ?>
|
printf(
|
||||||
|
'<span class="pledge-contributor__avatar">%s</span>',
|
||||||
|
get_avatar( $contrib->user_email, 30, 'blank' )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div><!-- .pledge-contributors -->
|
</div><!-- .pledge-contributors -->
|
||||||
|
|
||||||
</div><!-- .entry-content -->
|
</div><!-- .entry-content -->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue