mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Comments: Avoid a PHP notice in paginate_comments_links()
if type
argument is set to array.
The function is a wrapper for `paginate_links()`, which returns an array if requested. Props anantajitjg. Fixes #43299. Built from https://develop.svn.wordpress.org/trunk@42703 git-svn-id: http://core.svn.wordpress.org/trunk@42531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
abf27d78b9
commit
0a97d79899
@ -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 $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.
|
* @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 = '' ) {
|
function paginate_links( $args = '' ) {
|
||||||
global $wp_query, $wp_rewrite;
|
global $wp_query, $wp_rewrite;
|
||||||
|
@ -2896,7 +2896,7 @@ function previous_comments_link( $label = '' ) {
|
|||||||
* @global WP_Rewrite $wp_rewrite
|
* @global WP_Rewrite $wp_rewrite
|
||||||
*
|
*
|
||||||
* @param string|array $args Optional args. See paginate_links(). Default empty array.
|
* @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() ) {
|
function paginate_comments_links( $args = array() ) {
|
||||||
global $wp_rewrite;
|
global $wp_rewrite;
|
||||||
@ -2925,7 +2925,7 @@ function paginate_comments_links( $args = array() ) {
|
|||||||
$args = wp_parse_args( $args, $defaults );
|
$args = wp_parse_args( $args, $defaults );
|
||||||
$page_links = paginate_links( $args );
|
$page_links = paginate_links( $args );
|
||||||
|
|
||||||
if ( $args['echo'] ) {
|
if ( $args['echo'] && 'array' !== $args['type'] ) {
|
||||||
echo $page_links;
|
echo $page_links;
|
||||||
} else {
|
} else {
|
||||||
return $page_links;
|
return $page_links;
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-alpha-42702';
|
$wp_version = '5.0-alpha-42703';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user