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
This commit is contained in:
Dion Hulse 2015-02-12 01:39:27 +00:00
parent 3cec3655e9
commit 3745cdc740
2 changed files with 6 additions and 2 deletions

View File

@ -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;

View File

@ -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.