Ticket #36571: 36571.3.diff
File 36571.3.diff, 2.4 KB (added by , 9 years ago) |
---|
-
src/wp-includes/comment-template.php
138 138 * address and use it for their own means good and bad. 139 139 * 140 140 * @since 0.71 141 * @since 4.6.0 The `$comment` parameter was added. 141 142 * 142 143 * @param string $linktext Optional. Text to display instead of the comment author's email address. 143 144 * Default empty. 144 145 * @param string $before Optional. Text or HTML to display before the email link. Default empty. 145 146 * @param string $after Optional. Text or HTML to display after the email link. Default empty. 147 * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. Default is the current comment. 146 148 */ 147 function comment_author_email_link( $linktext = '', $before = '', $after = '' ) {148 if ( $link = get_comment_author_email_link( $linktext, $before, $after ) )149 function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { 150 if ( $link = get_comment_author_email_link( $linktext, $before, $after, $comment ) ) { 149 151 echo $link; 152 } 150 153 } 151 154 152 155 /** … … 159 162 * address and use it for their own means good and bad. 160 163 * 161 164 * @since 2.7.0 165 * @since 4.6.0 The `$comment` parameter was added. 162 166 * 163 167 * @param string $linktext Optional. Text to display instead of the comment author's email address. 164 168 * Default empty. 165 169 * @param string $before Optional. Text or HTML to display before the email link. Default empty. 166 170 * @param string $after Optional. Text or HTML to display after the email link. Default empty. 171 * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. Default is the current comment. 167 172 * @return string 168 173 */ 169 function get_comment_author_email_link( $linktext = '', $before = '', $after = '' ) { 170 $comment = get_comment(); 174 function get_comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { 175 $comment = get_comment( $comment ); 176 171 177 /** 172 178 * Filter the comment author's email for display. 173 179 * … … 181 187 * @param WP_Comment $comment The comment object. 182 188 */ 183 189 $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); 190 184 191 if ((!empty($email)) && ($email != '@')) { 185 192 $display = ($linktext != '') ? $linktext : $email; 186 193 $return = $before;