diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 4896531e97..4f15c5f0b3 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -3768,7 +3768,7 @@ function language_attributes( $doctype = 'html' ) { * @type string $before_page_number A string to appear before the page number. Default empty. * @type string $after_page_number A string to append after the page number. Default empty. * } - * @return array|string|void String of page links or array of page links. + * @return string|array|void String of page links or array of page links. */ function paginate_links( $args = '' ) { global $wp_query, $wp_rewrite; diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 31ac27d21f..80a3743fbf 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -2896,7 +2896,7 @@ function previous_comments_link( $label = '' ) { * @global WP_Rewrite $wp_rewrite * * @param string|array $args Optional args. See paginate_links(). Default empty array. - * @return string|void Markup for pagination links. + * @return string|array|void Markup for comment page links or array of comment page links. */ function paginate_comments_links( $args = array() ) { global $wp_rewrite; @@ -2925,7 +2925,7 @@ function paginate_comments_links( $args = array() ) { $args = wp_parse_args( $args, $defaults ); $page_links = paginate_links( $args ); - if ( $args['echo'] ) { + if ( $args['echo'] && 'array' !== $args['type'] ) { echo $page_links; } else { return $page_links;