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. Built from https://develop.svn.wordpress.org/trunk@51081 git-svn-id: http://core.svn.wordpress.org/trunk@50690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aeebd14fe2
commit
50fd820621
|
@ -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,
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-alpha-51080';
|
||||
$wp_version = '5.8-alpha-51081';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue