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

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

Called by

    Invoked by

      Calls

      Call hooks

      API Letters: ,,