mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user