Pledge Log: Log user of CLI actions.

This commit is contained in:
Ian Dunn 2019-11-07 11:31:00 -08:00
parent c524d1b21b
commit 18228d367c
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
2 changed files with 11 additions and 3 deletions

View file

@ -36,9 +36,14 @@ namespace WordPressDotOrg\FiveForTheFuture\View;
<td>
<?php
$user = get_user_by( 'id', $entry['user_id'] );
if ( $user ) : ?>
<?php echo sanitize_user( $user->user_login ); ?>
<?php endif; ?>
if ( $user ) {
echo sanitize_user( $user->user_login );
} elseif ( ! empty( $entry['user_id'] ) ) {
echo esc_html( $entry['user_id'] );
}
?>
</td>
</tr>
<?php endforeach; ?>