Advertisements

remove_query_arg

Definition:
function remove_query_arg( $key, $query=false ) {}

Removes an item or list from the query string.

Parameters

  • string|array $key: Query key or keys to remove.
  • bool $query: When false uses the $_SERVER value.

Return values

returns:New URL query string.

Source code

function remove_query_arg( $key, $query=false ) {

	if ( is_array( $key ) ) { // removing multiple keys

		foreach ( $key as $k )

			$query = add_query_arg( $k, false, $query );

		return $query;

	}

	return add_query_arg( $key, false, $query );

}

2719

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: