unregister_default_headers

Unregister default headers.

Description

(bool|void) unregister_default_headers( (string|array) $header ); 

This function must be called after register_default_headers() has already added the header you want to remove.

Returns (bool|void)

A single header returns true on success, false on failure. There is currently no return value for multiple headers.

Parameters (1)

0. $header (string|array)
The header string id (key of array) to remove, or an array thereof.

Usage

  1. if ( !function_exists( 'unregister_default_headers' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4. // The header string id (key of array) to remove, or an array thereof. 
  5. $header = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = unregister_default_headers($header); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/theme.php  
  1. function unregister_default_headers( $header ) { 
  2. global $_wp_default_headers; 
  3. if ( is_array( $header ) ) { 
  4. array_map( 'unregister_default_headers', $header ); 
  5. } elseif ( isset( $_wp_default_headers[ $header ] ) ) { 
  6. unset( $_wp_default_headers[ $header ] ); 
  7. return true; 
  8. } else { 
  9. return false;