Opened 11 years ago
Closed 11 years ago
#25310 closed defect (bug) (fixed)
comment_reply_link() doesn't work properly
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Inline Docs | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hi,
I was hired for a client job and I was working on it,
The client asked me to design a custom template for comments.
I decided to not use wp_list_comments then fetch data using available wp functions and when I was trying to create reply link the function comment_reply_link() and get_comment_reply_link() failed to generate and print the link
To make sure that my work is not wrong I checked different formats of using function and it's parameters as below:
comment_reply_link()
comment_reply_link(array())
comment_reply_link(array(), comment_ID(), the_ID())
Also I passed comment id and post id directly to test but failed
Note: Even I passed some parameters to first arguement
tnx
Ramin MT
Attachments (1)
Change History (13)
#2
in reply to:
↑ 1
@
11 years ago
Replying to SergeyBiryukov:
get_comment_reply_link()
bails out early ifdepth
argument is not passed:
tags/3.6.1/wp-includes/comment-template.php#L1043.
So you mean I must set this argument? Right?
#3
@
11 years ago
It looks like max_depth
is also required, so this should work:
comment_reply_link( array( 'depth' => 1, 'max_depth' => get_option( 'thread_comments_depth' ) ) );
#4
follow-up:
↓ 5
@
11 years ago
You may want to take a look how Twenty Twelve or Twenty Eleven define a custom comment callback instead of avoiding wp_list_comments()
.
#5
in reply to:
↑ 4
@
11 years ago
Replying to SergeyBiryukov:
You may want to take a look how Twenty Twelve or Twenty Eleven define a custom comment callback instead of avoiding
wp_list_comments()
.
Thanks bro, that snippet works fine ;)
About using custom comment fallback I should tell that I was seen it in codex documents.
I tried it and I found that is works fine.
Anyway thank you for your help :)
Ramin MT
#6
follow-up:
↓ 7
@
11 years ago
- Keywords needs-docs added
Perhaps we should mention in Codex or in the inline docs that depth
and max_depth
are required if the function is called separately from wp_list_comments()
(if that makes sense). Currently $args
is marked as optional.
#7
in reply to:
↑ 6
@
11 years ago
Replying to SergeyBiryukov:
Perhaps we should mention in Codex or in the inline docs that
depth
andmax_depth
are required if the function is called separately fromwp_list_comments()
(if that makes sense). Currently$args
is marked as optional.
Yes, your're right
In the Codex $args
is marked as optional but after your description I got that those are required and I will fix the Codex documents soon
Ramin MT
#8
@
11 years ago
- Keywords needs-docs removed
25310.diff adds functional docs for get_comment_reply_link()
and filter docs for the comment_reply_link
hook.
Side note: I added a todo note in get_post_reply_link()
for the docs team for when we get around to standardizing the docs in this file.
get_comment_reply_link()
bails out early ifdepth
argument is not passed:tags/3.6.1/wp-includes/comment-template.php#L1043.