Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: delete_widget

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
404                $_POST    = array(
405                     'sidebar'         => $sidebar_id,
406                     "widget-$id_base" => array(),
407                     'the-widget-id'   => $widget_id,
408                     'delete_widget'   => '1',
409                );
410                $_REQUEST = $_POST;
411
412                /** This action is documented in wp-admin/widgets-form.php */
413                do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
414
415                $callback = $wp_registered_widget_updates[ $id_base ]['callback'];
416                $params   = $wp_registered_widget_updates[ $id_base ]['params'];
417
418                if ( is_callable( $callback ) ) {
419                     ob_start();
420                     call_user_func_array( $callback, $params );
421                     ob_end_clean();
422                }