Make WordPress Core

Ticket #22380: improve-hooks-comments.patch

File improve-hooks-comments.patch, 3.8 KB (added by momo360modena, 13 years ago)
  • wp-includes/comment-template.php

    ### Eclipse Workspace Patch 1.0
    #P WordPress_Trunk
     
    3232        } else {
    3333                $author = $comment->comment_author;
    3434        }
    35         return apply_filters('get_comment_author', $author);
     35        return apply_filters('get_comment_author', $author, $comment_ID, $comment);
    3636}
    3737
    3838/**
     
    4444 * @param int $comment_ID The ID of the comment for which to print the author. Optional.
    4545 */
    4646function comment_author( $comment_ID = 0 ) {
    47         $author = apply_filters('comment_author', get_comment_author( $comment_ID ) );
     47        $author = apply_filters('comment_author', get_comment_author( $comment_ID ), $comment_ID );
    4848        echo $author;
    4949}
    5050
     
    6060 */
    6161function get_comment_author_email( $comment_ID = 0 ) {
    6262        $comment = get_comment( $comment_ID );
    63         return apply_filters('get_comment_author_email', $comment->comment_author_email);
     63        return apply_filters('get_comment_author_email', $comment->comment_author_email, $comment_ID);
    6464}
    6565
    6666/**
     
    7878 * @param int $comment_ID The ID of the comment for which to print the author's email. Optional.
    7979 */
    8080function comment_author_email( $comment_ID = 0 ) {
    81         echo apply_filters('author_email', get_comment_author_email( $comment_ID ) );
     81        echo apply_filters('author_email', get_comment_author_email( $comment_ID ), $comment_ID );
    8282}
    8383
    8484/**
     
    153153                $return = $author;
    154154        else
    155155                $return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
    156         return apply_filters('get_comment_author_link', $return);
     156        return apply_filters('get_comment_author_link', $return, $comment_ID);
    157157}
    158158
    159159/**
     
    180180 */
    181181function get_comment_author_IP( $comment_ID = 0 ) {
    182182        $comment = get_comment( $comment_ID );
    183         return apply_filters('get_comment_author_IP', $comment->comment_author_IP);
     183        return apply_filters('get_comment_author_IP', $comment->comment_author_IP, $comment_ID);
    184184}
    185185
    186186/**
     
    208208        $comment = get_comment( $comment_ID );
    209209        $url = ('http://' == $comment->comment_author_url) ? '' : $comment->comment_author_url;
    210210        $url = esc_url( $url, array('http', 'https') );
    211         return apply_filters('get_comment_author_url', $url);
     211        return apply_filters('get_comment_author_url', $url, $comment_ID, $comment);
    212212}
    213213
    214214/**
     
    221221 * @param int $comment_ID The ID of the comment for which to print the author's URL. Optional.
    222222 */
    223223function comment_author_url( $comment_ID = 0 ) {
    224         echo apply_filters('comment_url', get_comment_author_url( $comment_ID ));
     224        echo apply_filters('comment_url', get_comment_author_url( $comment_ID ), $comment_ID);
    225225}
    226226
    227227/**
     
    375375                $date = mysql2date(get_option('date_format'), $comment->comment_date);
    376376        else
    377377                $date = mysql2date($d, $comment->comment_date);
    378         return apply_filters('get_comment_date', $date, $d);
     378        return apply_filters('get_comment_date', $date, $d, $comment_ID);
    379379}
    380380
    381381/**
     
    420420                $excerpt .= $blah[$i] . ' ';
    421421        }
    422422        $excerpt .= ($use_dotdotdot) ? '...' : '';
    423         return apply_filters('get_comment_excerpt', $excerpt);
     423        return apply_filters('get_comment_excerpt', $excerpt, $comment_ID);
    424424}
    425425
    426426/**
     
    432432 * @param int $comment_ID The ID of the comment for which to print the excerpt. Optional.
    433433 */
    434434function comment_excerpt( $comment_ID = 0 ) {
    435         echo apply_filters('comment_excerpt', get_comment_excerpt($comment_ID) );
     435        echo apply_filters('comment_excerpt', get_comment_excerpt($comment_ID), $comment_ID );
    436436}
    437437
    438438/**
     
    662662        if ( '' == $comment->comment_type )
    663663                $comment->comment_type = 'comment';
    664664
    665         return apply_filters('get_comment_type', $comment->comment_type);
     665        return apply_filters('get_comment_type', $comment->comment_type, $comment_ID, $comment);
    666666}
    667667
    668668/**