WordPress.org

Make WordPress Core

Changeset 10778


Ignore:
Timestamp:
03/13/09 21:58:18 (6 years ago)
Author:
ryan
Message:

get_comment_link filter. Props Viper007Bond. fixes #9327

File:
1 edited

Legend:

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

    r10732 r10778  
    443443 * @param object|string|int $comment Comment to retrieve. 
    444444 * @param array $args Optional args. 
    445  * @return string The permalink to the current comment 
     445 * @return string The permalink to the given comment. 
    446446 */ 
    447447function get_comment_link( $comment = null, $args = array() ) { 
     
    473473 
    474474        if ( $wp_rewrite->using_permalinks() ) 
    475             return user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' ) . '#comment-' . $comment->comment_ID; 
     475            $link = user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' ); 
    476476        else 
    477             return add_query_arg( 'cpage', $args['page'], get_permalink( $comment->comment_post_ID ) ) . '#comment-' . $comment->comment_ID; 
     477            $link = add_query_arg( 'cpage', $args['page'], get_permalink( $comment->comment_post_ID ) ); 
    478478    } else { 
    479         return get_permalink( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID; 
    480     } 
     479        $link = get_permalink( $comment->comment_post_ID ); 
     480    } 
     481 
     482    return apply_filters( 'get_comment_link', $link . '#comment-' . $comment->comment_ID, $comment, $args ); 
    481483} 
    482484 
Note: See TracChangeset for help on using the changeset viewer.