mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-18 17:33:43 +03:00
Change rendered avatar size
Reduces the standard fetched avatar size, dependant on the format.
This commit is contained in:
parent
4444fd3dc8
commit
cf4c3db626
|
@ -16,9 +16,13 @@ $is_truncated = isset( $attributes['className'] ) && str_contains( $attributes['
|
|||
// Initialize count to zero for untruncated view.
|
||||
$count_more = 0;
|
||||
|
||||
// Set avatar size at smallest usage in px.
|
||||
$avatar_size = 30;
|
||||
|
||||
if ( $is_truncated ) {
|
||||
$count_more = count( $contributors ) - TRUNCATED_MAX;
|
||||
$contributors = array_splice( $contributors, 0, TRUNCATED_MAX );
|
||||
$avatar_size = 70;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@ -31,7 +35,7 @@ if ( $is_truncated ) {
|
|||
<li class="pledge-contributor">
|
||||
<span class="pledge-contributor__avatar">
|
||||
<a href="<?php echo esc_url( 'https://profiles.wordpress.org/' . $contributor->user_nicename . '/' ); ?>">
|
||||
<?php echo get_avatar( $contributor->user_email, 280, 'mystery', $contributor->display_name ); ?>
|
||||
<?php echo get_avatar( $contributor->user_email, $avatar_size, 'mystery', $contributor->display_name ); ?>
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
|
|
Loading…
Reference in a new issue