Skip to content

Commit a8723b8

Browse files
committed
Use same filter to control email display
1 parent fce71fe commit a8723b8

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

common/php/class-module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ function users_select_form( $selected = null, $args = null ) {
504504

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

507-
<?php if ( apply_filters( 'ef_users_select_form_show_email_address', true, $user ) ) : ?>
507+
<?php if ( apply_filters( 'ef_display_user_email_address', true, $user->ID ) ) : ?>
508508
<span class="ef-user_useremail"><?php echo esc_html( $user->user_email ); ?></span>
509509
<?php endif; ?>
510510
</label>

modules/editorial-comments/editorial-comments.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,10 @@ function the_comment($comment, $args, $depth) {
286286
}
287287
}
288288

289+
$escaped_comment_author = esc_html( $comment->comment_author );
290+
if ( apply_filters( 'ef_display_user_email_address', true, $comment->user_id ) ) {
291+
$escaped_comment_author = get_comment_author_email_link( $comment->comment_author );
292+
}
289293
?>
290294

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

0 commit comments

Comments
 (0)