Query: Add a `WP::remove_query_var()` helper function.

This makes cleaning up public query vars easier.

Fixes #35234.
Built from https://develop.svn.wordpress.org/trunk@36177


git-svn-id: http://core.svn.wordpress.org/trunk@36144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Pascal Birchler 2016-01-05 20:57:28 +00:00
parent c9d7fb9b28
commit 85bb9aa5fb
2 changed files with 12 additions and 1 deletions

View File

@ -95,6 +95,17 @@ class WP {
$this->public_query_vars[] = $qv;
}
/**
* Remove name from list of public query variables.
*
* @since 4.5.0
*
* @param string $name Query variable name.
*/
public function remove_query_var( $name ) {
$this->public_query_vars = array_diff( $this->public_query_vars, array( $name ) );
}
/**
* Set the value of a query variable.
*

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-alpha-36176';
$wp_version = '4.5-alpha-36177';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.