Avoid a PHP Warning when add_args is passed as false to paginate_links().

Props boonebgorges for the unit test.
See #30831 [31203].


git-svn-id: https://develop.svn.wordpress.org/trunk@31432 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2015-02-12 01:38:26 +00:00
parent d17168583d
commit afef491a75
2 changed files with 25 additions and 1 deletions
@@ -291,4 +291,24 @@ EXPECTED;
$_SERVER['REQUEST_URI'] = $request_uri;
}
/**
* @ticket 30831
*/
public function test_paginate_links_should_allow_add_args_to_be_bool_false() {
// Fake the query params.
$request_uri = $_SERVER['REQUEST_URI'];
$_SERVER['REQUEST_URI'] = add_query_arg( 'foo', 3, home_url() );
$links = paginate_links( array(
'add_args' => false,
'base' => add_query_arg( 'foo', '%#%' ),
'format' => '',
'total' => 5,
'current' => 3,
'type' => 'array',
) );
$this->assertContains( "<span class='page-numbers current'>3</span>", $links );
}
}