Allow empty uris to be passed to add_query_arg(). Useful when appending arguments to WP_Query query strings that do not yet have any arguments.
git-svn-id: https://develop.svn.wordpress.org/trunk@1872 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6641104194
commit
d2e0a1c81a
@ -2348,11 +2348,13 @@ function add_query_arg() {
|
||||
$uri = @func_get_arg(1);
|
||||
}
|
||||
else {
|
||||
if (@func_num_args() < 3) {
|
||||
$uri = $_SERVER['REQUEST_URI'];
|
||||
} else {
|
||||
$uri = @func_get_arg(2);
|
||||
}
|
||||
if ('' == $uri) {
|
||||
$uri = $_SERVER['REQUEST_URI'];
|
||||
}
|
||||
|
||||
if (strstr($uri, '?')) {
|
||||
$parts = explode('?', $uri, 2);
|
||||
if (1 == count($parts)) {
|
||||
|
Loading…
Reference in New Issue
Block a user