remove_query_arg() – Removes an item or items from a query string.

You appear to be a bot. Output may be restricted

Description

Removes an item or items from a query string.

Usage

$string = remove_query_arg( $key, $query );

Parameters

$key
( string|string[] ) required – Query key or keys to remove.
$query
( false|string ) optional – Optional. When false uses the current URL. Default false.

Returns

string New URL query string.

Source

File name: wordpress/wp-includes/functions.php
Lines:

1 to 9 of 9
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 );
}
 

 View on GitHub View on Trac