mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-19 00:15:44 +03:00
New blocks: Add blocks for the pledge contributors & pledge teams lists
This commit is contained in:
parent
cbabdbb33e
commit
b22bde9415
13 changed files with 1030 additions and 9 deletions
25
themes/wporg-5ftf-2024/src/pledge-teams/render.php
Normal file
25
themes/wporg-5ftf-2024/src/pledge-teams/render.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
use WordPressDotOrg\FiveForTheFuture\XProfile;
|
||||
|
||||
if ( ! $block->context['postId'] ) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$contribution_data = XProfile\get_aggregate_contributor_data_for_pledge( $block->context['postId'] );
|
||||
|
||||
?>
|
||||
<div
|
||||
<?php echo get_block_wrapper_attributes(); // phpcs:ignore ?>
|
||||
>
|
||||
<ul class="team-grid">
|
||||
<?php foreach ( $contribution_data['teams'] as $team ) :
|
||||
$badge_classes = XProfile\get_association_classes( $team );
|
||||
?>
|
||||
<li>
|
||||
<div class="badge item dashicons <?php echo esc_attr( implode( ' ', $badge_classes ) ); ?>"></div>
|
||||
<span class="badge-label"><?php echo esc_html( $team ); ?></span>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue