[wp-trac] [WordPress Trac] #29454: comments_link filter can not be run on comments_popup_link if post has no comments.
WordPress Trac
noreply at wordpress.org
Mon Sep 1 15:43:09 UTC 2014
#29454: comments_link filter can not be run on comments_popup_link if post has no
comments.
--------------------------+-----------------------------
Reporter: joedolson | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version: trunk
Severity: normal | Keywords:
Focuses: template |
--------------------------+-----------------------------
The filter 'comments_link' is run in the function comments_link(), called
by comments_popup_link(). However, if a post has no comments, it doesn't
call comments_link(); it calls get_permalink() and appends hashtag
fragment (basically, recreating what comments_link() does.)
This means that you can't filter the comments link separately from the
permalink if a post has no comments.
Additionally, comments_link() is a deprecated function, so core shouldn't
be using it.
Patch uses get_comments_link regardless of number of comments & removes
comments_link from function.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29454>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list