unregister_sidebar

Removes a sidebar from the list.

Description

unregister_sidebar( (string) $name ); 

Parameters (1)

0. $name (string)
The ID of the sidebar when it was added.

Usage

  1. if ( !function_exists( 'unregister_sidebar' ) ) { 
  2. require_once ABSPATH . WPINC . '/widgets.php'; 
  3.  
  4. // The ID of the sidebar when it was added. 
  5. $name = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = unregister_sidebar($name); 
  9.  

Defined (1)

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

/wp-includes/widgets.php  
  1. function unregister_sidebar( $name ) { 
  2. global $wp_registered_sidebars; 
  3.  
  4. unset( $wp_registered_sidebars[ $name ] );