[wp-trac] Re: [WordPress Trac] #7956: get_comment_link() should be
paged comments aware
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 24 08:10:38 GMT 2008
#7956: get_comment_link() should be paged comments aware
--------------------------+-------------------------------------------------
Reporter: Viper007Bond | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 2.7
Component: Comments | Version: 2.7
Severity: normal | Resolution:
Keywords: |
--------------------------+-------------------------------------------------
Comment (by Viper007Bond):
Actually, I'm going to leave this to a code ninja master. I can't handle
this when threading is enabled.
My idea is we need a Walker function that will walk through all elements
looking for the specified element and when it's found, it returns the
current page number.
{{{
function get_comment_link($comment = null) {
$comment = get_comment($comment);
if ( get_option('page_comments') ) {
/* do the stuff here */
} else {
return get_permalink( $comment->comment_post_ID ) .
'#comment-' . $comment->comment_ID;
}
}
}}}
--
Ticket URL: <http://trac.wordpress.org/ticket/7956#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list