[wp-trac] [WordPress Trac] #19893: get_comments_link() doesn't link properly if there are no responses
WordPress Trac
wp-trac at lists.automattic.com
Wed Jan 25 03:35:53 UTC 2012
#19893: get_comments_link() doesn't link properly if there are no responses
-------------------------+-----------------------------
Reporter: cgrymala | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version:
Severity: minor | Keywords: has-patch
-------------------------+-----------------------------
Since the current implementation of get_comments_link() simply returns the
permalink with `#comments` appended to the end of it, and the HTML element
with an ID of `comments` only exists when existing comments are wrapped
inside of it, it doesn't lead to anything when there are 0 comments on the
post.
I've attached a patch that checks whether there are any comments on the
post or not; and, if not, it appends `#respond` to the end of the link;
otherwise it appends `#comments`.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19893>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list