Make WordPress Core

Ticket #36571: 36571.3.diff

File 36571.3.diff, 2.4 KB (added by DrewAPicture, 9 years ago)

Docs

  • src/wp-includes/comment-template.php

     
    138138 * address and use it for their own means good and bad.
    139139 *
    140140 * @since 0.71
     141 * @since 4.6.0 The `$comment` parameter was added.
    141142 *
    142143 * @param string $linktext Optional. Text to display instead of the comment author's email address.
    143144 *                         Default empty.
    144145 * @param string $before   Optional. Text or HTML to display before the email link. Default empty.
    145146 * @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.
    146148 */
    147 function comment_author_email_link( $linktext = '', $before = '', $after = '' ) {
    148         if ( $link = get_comment_author_email_link( $linktext, $before, $after ) )
     149function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
     150        if ( $link = get_comment_author_email_link( $linktext, $before, $after, $comment ) ) {
    149151                echo $link;
     152        }
    150153}
    151154
    152155/**
     
    159162 * address and use it for their own means good and bad.
    160163 *
    161164 * @since 2.7.0
     165 * @since 4.6.0 The `$comment` parameter was added.
    162166 *
    163167 * @param string $linktext Optional. Text to display instead of the comment author's email address.
    164168 *                         Default empty.
    165169 * @param string $before   Optional. Text or HTML to display before the email link. Default empty.
    166170 * @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.
    167172 * @return string
    168173 */
    169 function get_comment_author_email_link( $linktext = '', $before = '', $after = '' ) {
    170         $comment = get_comment();
     174function get_comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = 0 ) {
     175        $comment = get_comment( $comment );
     176
    171177        /**
    172178         * Filter the comment author's email for display.
    173179         *
     
    181187         * @param WP_Comment $comment              The comment object.
    182188         */
    183189        $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
     190
    184191        if ((!empty($email)) && ($email != '@')) {
    185192        $display = ($linktext != '') ? $linktext : $email;
    186193                $return  = $before;