Skip to content

Commit

Permalink
Merge pull request #220 from WordPress/count-participants
Browse files Browse the repository at this point in the history
Add number of contributors and attendees
  • Loading branch information
trymebytes authored Apr 17, 2024
2 parents 483e8c5 + ff97a78 commit 4baa113
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions templates/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@
</div>
<?php if ( ! empty( $contributors ) ) : ?>
<div class="event-contributors">
<h2><?php esc_html_e( 'Contributors', 'gp-translation-events' ); ?></h2>
<h2>
<?php
// translators: %d is the number of contributors.
echo esc_html( sprintf( __( 'Contributors (%d)', 'gp-translation-events' ), number_format_i18n( count( $contributors ) ) ) );
?>
</h2>
<ul>
<?php foreach ( $contributors as $contributor ) : ?>
<li class="event-contributor" title="<?php echo esc_html( implode( ', ', $contributor->locales ) ); ?>">
Expand Down Expand Up @@ -77,7 +82,12 @@
<?php endif; ?>
<?php if ( ! empty( $attendees ) && ( ! $event->end()->is_in_the_past() || ( ( $attendee instanceof Attendee && $attendee->is_host() ) || current_user_can( 'manage_options' ) || $user->ID === $event->author_id() ) ) ) : ?>
<div class="event-attendees">
<h2><?php esc_html_e( 'Attendees', 'gp-translation-events' ); ?></h2>
<h2>
<?php
// translators: %d is the number of attendees.
echo esc_html( sprintf( __( 'Attendees (%d)', 'gp-translation-events' ), number_format_i18n( count( $attendees ) ) ) );
?>
</h2>
<ul>
<?php foreach ( $attendees as $_user ) : ?>
<li class="event-attendee">
Expand Down

0 comments on commit 4baa113

Please sign in to comment.