Opened 20 years ago
Closed 20 years ago
#1408 closed defect (bug) (fixed)
comments_popup_link() returns incorrect URI when there are zero comments [patch]
Reported by: | matthewc | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Priority: | low | |
Severity: | minor | Version: | 1.5.1.1 |
Component: | General | Keywords: | comments link bg|commit bg|has-patch |
Focuses: | Cc: |
Description
When popup comments are disabled, the function comments_popup_link()
echos the URI permalink#comments
even when there are no comments present. In the default template the heading with the id #comments
does not exist on the page until the first comment has been submitted. When there are zero comments, comments_popup_link()
should echo permalink#respond
instead.
My fix for this is as follows:
In comment-functions.php, replace line 121...
comments_link();
with the following...
if (0 == $number) { echo get_permalink() . '#respond'; } else { comments_link(); }
Attachments (1)
Change History (7)
#2
@
20 years ago
- Keywords comments link added
- Owner changed from anonymous to matt
Sounds good to me. I made a patch for 1.5 branch
#3
@
20 years ago
- Owner changed from matt to markjaquith
- Status changed from new to assigned
- Summary changed from comments_popup_link() returns incorrect URI when there are zero comments to comments_popup_link() returns incorrect URI when there are zero comments [patch]
Note: See
TracTickets for help on using
tickets.
This problem exists in the non-popup default comments template as well.