delete_widget

This action is documented in wp-admin/widgets.php.

Description

do_action( 'delete_widget', (unknown) $widget_id, (unknown) $sidebar_id, (unknown) $id_base ); 

Parameters (3)

0. $widget_id (unknown)
The widget id.
1. $sidebar_id (unknown)
The sidebar id.
2. $id_base (unknown)
The id base.

Usage

To run the hook, copy the example below.
  1. // run the action 
  2. do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base ); 
The following example is for adding a hook callback.
  1. // define the delete_widget callback 
  2. function action_delete_widget( $widget_id, $sidebar_id, $id_base ) { 
  3. // make action magic happen here... 
  4. }; 
  5.  
  6. // add the action 
  7. add_action( 'delete_widget', 'action_delete_widget', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the action 
  2. remove_action( 'delete_widget', 'action_delete_widget', 10, 3 ); 

Defined (2)

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

/wp-admin/includes/ajax-actions.php  
  1. do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base ); 
/wp-admin/widgets.php  
  1. do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );