Single Pledge: Add intro message to pledges for clarity.

This commit is contained in:
Ian Dunn 2021-04-30 12:55:55 -07:00
parent 325a6d71e2
commit 7174ae2fb6
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
16 changed files with 222 additions and 166 deletions

View file

@ -14,7 +14,9 @@ foreach ( PledgeMeta\get_pledge_meta_config() as $key => $config ) {
$data[ $key ] = get_post_meta( get_the_ID(), PledgeMeta\META_PREFIX . $key, $config['single'] );
}
$contributors = Contributor\get_pledge_contributors( get_the_ID() );
$contributors = Contributor\get_contributor_user_objects(
Contributor\get_pledge_contributors( get_the_ID() )
);
$allowed_html = array_merge(
wp_kses_allowed_html( 'data' ),
@ -74,22 +76,19 @@ $contributor_title = sprintf(
<?php echo wp_kses( $content, $allowed_html ); ?>
</p>
<div class="pledge-contributors">
<?php /* phpcs:ignore -- escaped above */ ?>
<h3><?php echo $contributor_title ?></h3>
<?php /* phpcs:ignore -- escaped above */ ?>
<h3><?php echo $contributor_title ?></h3>
<ul class="pledge-contributors">
<?php
foreach ( $contributors as $contrib_post ) {
$contrib = get_user_by( 'login', $contrib_post->post_title );
if ( $contrib ) {
printf(
'<span class="pledge-contributor__avatar">%s</span>',
get_avatar( $contrib->user_email, 30, 'blank' )
);
}
foreach ( $contributors as $contrib_user ) {
printf(
'<li class="pledge-contributor__avatar">%s</li>',
get_avatar( $contrib_user->user_email, 40, 'mystery', $contrib_user->display_name )
);
}
?>
</div><!-- .pledge-contributors -->
</ul><!-- .pledge-contributors -->
</div><!-- .entry-content -->
</article><!-- #post-## -->