Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow author email addresses to stay private #577

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions common/php/class-module.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,10 @@ function users_select_form( $selected = null, $args = null ) {
if ( !is_array($selected) ) $selected = array();
?>

<?php if( !empty($users) ) : ?>
<?php if ( ! empty ( $users ) ) : ?>
<ul class="<?php echo esc_attr( $list_class ) ?>">
<?php foreach( $users as $user ) :
$checked = ( in_array($user->ID, $selected) ) ? 'checked="checked"' : '';
<?php foreach( $users as $user ) :
$checked = ( in_array( $user->ID, $selected ) ) ? 'checked="checked"' : '';
// Add a class to checkbox of current user so we know not to add them in notified list during notifiedMessage() js function
$current_user_class = ( get_current_user_id() == $user->ID ) ? 'class="post_following_list-current_user" ' : '';
?>
Expand All @@ -503,7 +503,10 @@ function users_select_form( $selected = null, $args = null ) {
</div>

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

<?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>
</li>
<?php endforeach; ?>
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 = get_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'),
comment_author_email_link( $comment->comment_author ),
$escaped_comment_author,
get_comment_date( get_option( 'date_format' ) ),
get_comment_time() ); ?>
</h5>
Expand Down