From 3745cdc7402131ee501940779b1e4cb04d89ca05 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 12 Feb 2015 01:39:27 +0000 Subject: [PATCH] Avoid a PHP Warning when `add_args` is passed as `false` to `paginate_links()`. Props boonebgorges for the unit test. See #30831 [31203]. Built from https://develop.svn.wordpress.org/trunk@31432 git-svn-id: http://core.svn.wordpress.org/trunk@31413 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/general-template.php | 6 +++++- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-includes/general-template.php b/wp-includes/general-template.php index 6f0ff15c2d..15ec1e4396 100644 --- a/wp-includes/general-template.php +++ b/wp-includes/general-template.php @@ -2619,6 +2619,10 @@ function paginate_links( $args = '' ) { $args = wp_parse_args( $args, $defaults ); + if ( ! is_array( $args['add_args'] ) ) { + $args['add_args'] = array(); + } + // Merge additional query vars found in the original URL into 'add_args' array. if ( isset( $url_parts[1] ) ) { // Find the format argument. @@ -2644,7 +2648,7 @@ function paginate_links( $args = '' ) { if ( $mid_size < 0 ) { $mid_size = 2; } - $add_args = is_array( $args['add_args'] ) ? $args['add_args'] : false; + $add_args = $args['add_args']; $r = ''; $page_links = array(); $dots = false; diff --git a/wp-includes/version.php b/wp-includes/version.php index 8f3d56d137..2ad39dfca0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31429'; +$wp_version = '4.2-alpha-31432'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.