mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-17 15:45:44 +03:00
Single Pledge: Add intro message to pledges for clarity.
This commit is contained in:
parent
325a6d71e2
commit
7174ae2fb6
16 changed files with 222 additions and 166 deletions
|
@ -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-## -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue