WP::remove_query_var() WordPress Method

The WP::remove_query_var() method removes a query variable from the current URL. This is useful for removing unwanted query variables from the URL.

WP::remove_query_var( string $name ) #

Removes a query variable from a list of public query variables.


Parameters

$name

(string)(Required)Query variable name.


Top ↑

Source

File: wp-includes/class-wp.php

	public function remove_query_var( $name ) {
		$this->public_query_vars = array_diff( $this->public_query_vars, array( $name ) );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.