Make WordPress Core

Ticket #22380: 22380.diff

File 22380.diff, 7.4 KB (added by tareq1988, 11 years ago)
  • src/wp-includes/comment-template.php

    diff --git src/wp-includes/comment-template.php src/wp-includes/comment-template.php
    index ab03817..9b7b1d9 100644
    function get_comment_author( $comment_ID = 0 ) { 
    3636         *
    3737         * @since 1.5.0
    3838         *
    39          * @param string $author The comment author's username.
     39         * @param string $author     The comment author's username.
     40         * @param int    $comment_ID The comment ID
     41         * @param object $comment    The comment
    4042         */
    41         return apply_filters( 'get_comment_author', $author );
     43        return apply_filters( 'get_comment_author', $author, $comment_ID, $comment );
    4244}
    4345
    4446/**
    function comment_author( $comment_ID = 0 ) { 
    5658         * @since 1.2.0
    5759         *
    5860         * @param string $author The comment author's username.
     61         * @param int    $comment_ID The comment ID
    5962         */
    60         $author = apply_filters( 'comment_author', $author );
     63        $author = apply_filters( 'comment_author', $author, $comment_ID );
    6164        echo $author;
    6265}
    6366
    function get_comment_author_email( $comment_ID = 0 ) { 
    7780         * @since 1.5.0
    7881         *
    7982         * @param string $comment_author_email The comment author's email address.
     83         * @param int    $comment_ID           The comment ID
     84         * @param object $comment              The comment
    8085         */
    81         return apply_filters( 'get_comment_author_email', $comment->comment_author_email );
     86        return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment_ID, $comment );
    8287}
    8388
    8489/**
    function comment_author_email( $comment_ID = 0 ) { 
    102107         * @since 1.2.0
    103108         *
    104109         * @param string $author_email The comment author's email address.
     110         * @param int    $comment_ID   The comment ID
    105111         */
    106         echo apply_filters( 'author_email', $author_email );
     112        echo apply_filters( 'author_email', $author_email, $comment_ID );
    107113}
    108114
    109115/**
    function get_comment_author_email_link( $linktext = '', $before = '', $after = ' 
    156162         * @since 1.2.0
    157163         *
    158164         * @param string $comment_author_email The comment author's email address.
     165         * @param object $comment              The comment
    159166         */
    160         $email = apply_filters( 'comment_email', $comment->comment_author_email );
     167        $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment );
    161168        if ((!empty($email)) && ($email != '@')) {
    162169        $display = ($linktext != '') ? $linktext : $email;
    163170                $return  = $before;
    function get_comment_author_link( $comment_ID = 0 ) { 
    195202         *
    196203         * @since 1.5.0
    197204         *
    198          * @param string $return The HTML-formatted comment author link.
    199          *                       Empty for an invalid URL.
     205         * @param string $return      The HTML-formatted comment author link.
     206         *                            Empty for an invalid URL.
     207         * @param int    $comment_ID  The comment ID
    200208         */
    201         return apply_filters( 'get_comment_author_link', $return );
     209        return apply_filters( 'get_comment_author_link', $return, $author, $comment_ID );
    202210}
    203211
    204212/**
    function get_comment_author_IP( $comment_ID = 0 ) { 
    233241         * @since 1.5.0
    234242         *
    235243         * @param string $comment_author_IP The comment author's IP address.
     244         * @param int    $comment_ID        The comment ID
     245         * @param object $comment           The comment
    236246         */
    237         return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP );
     247        return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment_ID, $comment );
    238248}
    239249
    240250/**
    function get_comment_author_url( $comment_ID = 0 ) { 
    267277         *
    268278         * @since 1.5.0
    269279         *
    270          * @param string $url The comment author's URL.
     280         * @param string $url                   The comment author's URL.
     281         * @param int    $comment_ID    The comment ID
     282         * @param object $comment               The comment
    271283         */
    272         return apply_filters( 'get_comment_author_url', $url );
     284        return apply_filters( 'get_comment_author_url', $url, $comment_ID, $comment );
    273285}
    274286
    275287/**
    function comment_author_url( $comment_ID = 0 ) { 
    288300         * @since 1.2.0
    289301         *
    290302         * @param string $author_url The comment author's URL.
     303         * @param int    $comment_ID The comment ID
    291304         */
    292         echo apply_filters( 'comment_url', $author_url );
     305        echo apply_filters( 'comment_url', $author_url, $comment_ID );
    293306}
    294307
    295308/**
    function get_comment_author_url_link( $linktext = '', $before = '', $after = '' 
    317330        $display = ($linktext != '') ? $linktext : $url;
    318331        $display = str_replace( 'http://www.', '', $display );
    319332        $display = str_replace( 'http://', '', $display );
    320         if ( '/' == substr($display, -1) )
     333
     334        if ( '/' == substr($display, -1) ) {
    321335                $display = substr($display, 0, -1);
     336        }
     337
    322338        $return = "$before<a href='$url' rel='external'>$display</a>$after";
    323339
    324340        /**
    function get_comment_class( $class = '', $comment_id = null, $post_id = null ) { 
    445461         * @param array       $classes    An array of comment classes.
    446462         * @param string      $class      A comma-separated list of additional classes added to the list.
    447463         * @param int         $comment_id The comment id.
     464         * @param object          $comment    The comment
    448465         * @param int|WP_Post $post_id    The post ID or WP_Post object.
    449466         */
    450         return apply_filters( 'comment_class', $classes, $class, $comment_id, $post_id );
     467        return apply_filters( 'comment_class', $classes, $class, $comment_id, $comment, $post_id );
    451468}
    452469
    453470/**
    function get_comment_excerpt( $comment_ID = 0 ) { 
    506523        $comment = get_comment( $comment_ID );
    507524        $comment_text = strip_tags($comment->comment_content);
    508525        $blah = explode(' ', $comment_text);
     526
    509527        if (count($blah) > 20) {
    510528                $k = 20;
    511529                $use_dotdotdot = 1;
    function get_comment_excerpt( $comment_ID = 0 ) { 
    513531                $k = count($blah);
    514532                $use_dotdotdot = 0;
    515533        }
     534
    516535        $excerpt = '';
    517536        for ($i=0; $i<$k; $i++) {
    518537                $excerpt .= $blah[$i] . ' ';
    function get_comment_excerpt( $comment_ID = 0 ) { 
    524543         *
    525544         * @since 1.5.0
    526545         *
    527          * @param string $excerpt The comment excerpt text.
     546         * @param string $excerpt               The comment excerpt text.
     547         * @param int    $comment_ID    The comment ID
     548         * @param object $comment               The comment
    528549         */
    529         return apply_filters( 'get_comment_excerpt', $excerpt );
     550        return apply_filters( 'get_comment_excerpt', $excerpt, $comment_ID, $comment );
    530551}
    531552
    532553/**
    function comment_excerpt( $comment_ID = 0 ) { 
    544565         *
    545566         * @since 1.2.0
    546567         *
    547          * @param string $comment_excerpt The comment excerpt text.
     568         * @param string $comment_excerpt       The comment excerpt text.
     569         * @param int    $comment_ID            The comment ID
    548570         */
    549         echo apply_filters( 'comment_excerpt', $comment_excerpt );
     571        echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment_ID );
    550572}
    551573
    552574/**
    function get_comment_ID() { 
    563585         *
    564586         * @since 1.5.0
    565587         *
    566          * @param int $comment_ID The current comment ID.
     588         * @param int           $comment_ID The current comment ID.
     589         * @param object    $comment    The comment
    567590         */
    568         return apply_filters( 'get_comment_ID', $comment->comment_ID );
     591        return apply_filters( 'get_comment_ID', $comment->comment_ID, $comment );
    569592}
    570593
    571594/**
    function get_comment_type( $comment_ID = 0 ) { 
    870893         *
    871894         * @since 1.5.0
    872895         *
    873          * @param string $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
     896         * @param string  $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'.
     897         * @param int     $comment_ID   The comment ID
     898         * @param object  $comment      The comment
    874899         */
    875         return apply_filters( 'get_comment_type', $comment->comment_type );
     900        return apply_filters( 'get_comment_type', $comment->comment_type, $comment_ID, $comment );
    876901}
    877902
    878903/**