WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/10/2015 06:09:15 PM (6 years ago)
Author:
wonderboymusic
Message:

After [33961], ensure that comment filters that expect a comment ID are receiving one.

Props dimadin.
Fixes #33809.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r33963 r34008  
    4343     * @param WP_Comment $comment    The comment object.
    4444     */
    45     return apply_filters( 'get_comment_author', $author, $comment_ID, $comment );
     45    return apply_filters( 'get_comment_author', $author, $comment->comment_ID, $comment );
    4646}
    4747
     
    5555 */
    5656function comment_author( $comment_ID = 0 ) {
    57     $author = get_comment_author( $comment_ID );
     57    $comment = get_comment( $comment_ID );
     58    $author  = get_comment_author( $comment );
    5859
    5960    /**
     
    6667     * @param int    $comment_ID The comment ID.
    6768     */
    68     echo apply_filters( 'comment_author', $author, $comment_ID );
     69    echo apply_filters( 'comment_author', $author, $comment->comment_ID );
    6970}
    7071
     
    9192     * @param WP_Comment $comment              The comment object.
    9293     */
    93     return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment_ID, $comment );
     94    return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment );
    9495}
    9596
     
    109110 */
    110111function comment_author_email( $comment_ID = 0 ) {
    111     $author_email = get_comment_author_email( $comment_ID );
     112    $comment      = get_comment( $comment_ID );
     113    $author_email = get_comment_author_email( $comment );
    112114
    113115    /**
     
    120122     * @param int    $comment_ID   The comment ID.
    121123     */
    122     echo apply_filters( 'author_email', $author_email, $comment_ID );
     124    echo apply_filters( 'author_email', $author_email, $comment->comment_ID );
    123125}
    124126
     
    200202 */
    201203function get_comment_author_link( $comment_ID = 0 ) {
    202     $url    = get_comment_author_url( $comment_ID );
    203     $author = get_comment_author( $comment_ID );
     204    $comment = get_comment( $comment_ID );
     205    $url     = get_comment_author_url( $comment );
     206    $author  = get_comment_author( $comment );
    204207
    205208    if ( empty( $url ) || 'http://' == $url )
     
    219222     * @param int    $comment_ID The comment ID.
    220223     */
    221     return apply_filters( 'get_comment_author_link', $return, $author, $comment_ID );
     224    return apply_filters( 'get_comment_author_link', $return, $author, $comment->comment_ID );
    222225}
    223226
     
    256259     * @param WP_Comment $comment           The comment object.
    257260     */
    258     return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment_ID, $comment );
     261    return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment );
    259262}
    260263
     
    295298     * @param WP_Comment $comment    The comment object.
    296299     */
    297     return apply_filters( 'get_comment_author_url', $url, $comment_ID, $comment );
     300    return apply_filters( 'get_comment_author_url', $url, $comment->comment_ID, $comment );
    298301}
    299302
     
    307310 */
    308311function comment_author_url( $comment_ID = 0 ) {
    309     $author_url = get_comment_author_url( $comment_ID );
     312    $comment    = get_comment( $comment_ID );
     313    $author_url = get_comment_author_url( $comment );
    310314
    311315    /**
     
    318322     * @param int    $comment_ID The comment ID.
    319323     */
    320     echo apply_filters( 'comment_url', $author_url, $comment_ID );
     324    echo apply_filters( 'comment_url', $author_url, $comment->comment_ID );
    321325}
    322326
     
    485489     * @param int|WP_Post $post_id    The post ID or WP_Post object.
    486490     */
    487     return apply_filters( 'comment_class', $classes, $class, $comment_id, $comment, $post_id );
     491    return apply_filters( 'comment_class', $classes, $class, $comment->comment_ID, $comment, $post_id );
    488492}
    489493
     
    571575     * @param WP_Comment $comment    The comment object.
    572576     */
    573     return apply_filters( 'get_comment_excerpt', $excerpt, $comment_ID, $comment );
     577    return apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment );
    574578}
    575579
     
    583587 */
    584588function comment_excerpt( $comment_ID = 0 ) {
    585     $comment_excerpt = get_comment_excerpt($comment_ID);
     589    $comment         = get_comment( $comment_ID );
     590    $comment_excerpt = get_comment_excerpt( $comment );
    586591
    587592    /**
     
    594599     * @param int    $comment_ID      The comment ID.
    595600     */
    596     echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment_ID );
     601    echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID );
    597602}
    598603
     
    933938     * @param WP_Comment $comment      The comment object.
    934939     */
    935     return apply_filters( 'get_comment_type', $comment->comment_type, $comment_ID, $comment );
     940    return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment );
    936941}
    937942
Note: See TracChangeset for help on using the changeset viewer.