Skip to content

Commit

Permalink
Use same filter to control email display
Browse files Browse the repository at this point in the history
  • Loading branch information
WPprodigy committed Jan 16, 2020
1 parent fce71fe commit 2317f77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/php/class-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ function users_select_form( $selected = null, $args = null ) {

<span class="ef-user_displayname"><?php echo esc_html( $user->display_name ); ?></span>

<?php if ( apply_filters( 'ef_users_select_form_show_email_address', true, $user ) ) : ?>
<?php if ( apply_filters( 'ef_display_user_email_address', true, $user->ID ) ) : ?>
<span class="ef-user_useremail"><?php echo esc_html( $user->user_email ); ?></span>
<?php endif; ?>
</label>
Expand Down
6 changes: 5 additions & 1 deletion modules/editorial-comments/editorial-comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ function the_comment($comment, $args, $depth) {
}
}

$escaped_comment_author = esc_html( $comment->comment_author );
if ( apply_filters( 'ef_display_user_email_address', true, $comment->user_id ) ) {
$escaped_comment_author = comment_author_email_link( $comment->comment_author );
}
?>

<li id="comment-<?php echo esc_attr( $comment->comment_ID ); ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status($comment->comment_ID) ) ); ?>>
Expand All @@ -295,7 +299,7 @@ function the_comment($comment, $args, $depth) {
<div class="post-comment-wrap">
<h5 class="comment-meta">
<?php printf( __('<span class="comment-author">%1$s</span><span class="meta"> said on %2$s at %3$s</span>', 'edit-flow'),
esc_html( $comment->comment_author ),
$escaped_comment_author,
get_comment_date( get_option( 'date_format' ) ),
get_comment_time() ); ?>
</h5>
Expand Down

0 comments on commit 2317f77

Please sign in to comment.