[wp-trac] [WordPress Trac] #47174: Comment reply links are always to first comment form on a page when $withcomments variable is set to true
WordPress Trac
noreply at wordpress.org
Tue May 7 22:28:14 UTC 2019
#47174: Comment reply links are always to first comment form on a page when
$withcomments variable is set to true
--------------------------+-----------------------------
Reporter: johnh10 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Comments | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
This is a follow-up to #33383.
This bug has returned. I'm not sure which version re-introduced this, but
the original fix for #33383 (get_permalink) is missing in the current
comments-template.php
The WordPress v5.2 code starting at line 1695 of ''comments-template.php''
should be:
{{{#!php
<?php
$link = sprintf(
"<a rel='nofollow' class='comment-reply-link'
href='%s' %s aria-label='%s'>%s</a>",
esc_url(
add_query_arg(
array(
'replytocom' =>
$comment->comment_ID,
'unapproved' =>
false,
'moderation-hash' =>
false,
),
get_permalink($post->ID)
)
) . '#' . $args['respond_id'],
$data_attribute_string,
esc_attr( sprintf( $args['reply_to_text'],
$comment->comment_author ) ),
$args['reply_text']
);
}}}
After adding the get_permalink line it works as expected.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47174>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list