Contributors: Add Contributors CPT and related admin UI

This commit is contained in:
Corey McKrill 2019-10-21 15:00:50 -07:00
parent aaf8b1a712
commit 75428a3c95
No known key found for this signature in database
GPG key ID: C2C0746F7BF17E38
4 changed files with 158 additions and 36 deletions

View file

@ -28,7 +28,49 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
<?php else : ?>
<div class="5ftf-contributors">
<?php foreach ( $contributors as $status => $group ) : ?>
<?php if ( ! empty( $group ) ) : ?>
<h3 class="contributor-list-heading">
<?php
switch ( $status ) {
case 'pending':
esc_html_e( 'Unconfirmed', 'wporg' );
break;
case 'publish':
esc_html_e( 'Confirmed', 'wporg' );
break;
}
?>
</h3>
<ul class="contributor-list <?php echo esc_attr( $status ); ?>">
<?php foreach ( $group as $contributor_post ) :
$contributor = get_user_by( 'login', $contributor_post->post_title );
?>
<li>
<?php echo get_avatar( $contributor->user_email, 32 ); ?>
<?php echo $contributor_post->post_title; ?>
<!-- TODO These buttons don't do anything yet.
<button class="button-primary" data-action="remove" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
<?php esc_html_e( 'Remove', 'wporg' ); ?>
</button>
<?php if ( 'pending' === $contributor_post->post_status ) : ?>
<button class="button-secondary" data-action="resend-confirmation" data-contributor-post="<?php echo esc_attr( $contributor_post->ID ); ?>">
<?php esc_html_e( 'Resend confirmation', 'wporg' ); ?>
</button>
<?php endif; ?>
-->
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endforeach; ?>
<!-- TODO This button doesn't do anything yet.
<button class="button-primary" data-action="add-contributor">
<?php esc_html_e( 'Add new contributor', 'wporg' ); ?>
</button>
-->
</div>
<?php endif; ?>