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:
parent
3cec3655e9
commit
3745cdc740
|
@ -2619,6 +2619,10 @@ function paginate_links( $args = '' ) {
|
||||||
|
|
||||||
$args = wp_parse_args( $args, $defaults );
|
$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.
|
// Merge additional query vars found in the original URL into 'add_args' array.
|
||||||
if ( isset( $url_parts[1] ) ) {
|
if ( isset( $url_parts[1] ) ) {
|
||||||
// Find the format argument.
|
// Find the format argument.
|
||||||
|
@ -2644,7 +2648,7 @@ function paginate_links( $args = '' ) {
|
||||||
if ( $mid_size < 0 ) {
|
if ( $mid_size < 0 ) {
|
||||||
$mid_size = 2;
|
$mid_size = 2;
|
||||||
}
|
}
|
||||||
$add_args = is_array( $args['add_args'] ) ? $args['add_args'] : false;
|
$add_args = $args['add_args'];
|
||||||
$r = '';
|
$r = '';
|
||||||
$page_links = array();
|
$page_links = array();
|
||||||
$dots = false;
|
$dots = false;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue