wp_unregister_sidebar_widget

Remove widget from sidebar.

Description

wp_unregister_sidebar_widget( (int|string) $id ); 

Parameters (1)

0. $id (int|string)
Widget ID.

Usage

  1. if ( !function_exists( 'wp_unregister_sidebar_widget' ) ) { 
  2. require_once ABSPATH . WPINC . '/widgets.php'; 
  3.  
  4. // Widget ID. 
  5. $id = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wp_unregister_sidebar_widget($id); 
  9.  

Defined (1)

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

/wp-includes/widgets.php  
  1. function wp_unregister_sidebar_widget($id) { 
  2.  
  3. /** 
  4. * Fires just before a widget is removed from a sidebar. 
  5. * @since 3.0.0 
  6. * @param int $id The widget ID. 
  7. */ 
  8.