mirror of
git://develop.git.wordpress.org/
synced 2025-04-05 04:33:18 +02:00
Comments: Return valid comment reply link if comments are paginated.
Fix the link returned by `get_comment_reply_link()` so the link points to the correct page of comments when links are paginated. While this link is normally overridden by the comment-reply script, if that script is disabled, the link would point to a location that did not exist when comments were paginated. props MrPauloEn, paaggeli, alexstine, engahmeds3ed. Fixes #51189. git-svn-id: https://develop.svn.wordpress.org/trunk@51081 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
bcefcefb58
commit
40a61e6c14
@ -1647,7 +1647,7 @@ function comments_popup_link( $zero = false, $one = false, $more = false, $css_c
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object.
|
||||
*
|
||||
*
|
||||
* @param array $args {
|
||||
* Optional. Override default arguments.
|
||||
*
|
||||
@ -1706,6 +1706,12 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( get_option( 'page_comments' ) ) {
|
||||
$permalink = str_replace( '#comment-' . $comment->comment_ID, '', get_comment_link( $comment ) );
|
||||
} else {
|
||||
$permalink = get_permalink( $post->ID );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the comment reply link arguments.
|
||||
*
|
||||
@ -1750,7 +1756,7 @@ function get_comment_reply_link( $args = array(), $comment = null, $post = null
|
||||
'unapproved' => false,
|
||||
'moderation-hash' => false,
|
||||
),
|
||||
get_permalink( $post->ID )
|
||||
$permalink
|
||||
)
|
||||
) . '#' . $args['respond_id'],
|
||||
$data_attribute_string,
|
||||
|
Loading…
x
Reference in New Issue
Block a user