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
160           /**
161            * Fires immediately after a widget has been marked for deletion.
162            *
163            * @since 4.4.0
164            *
165            * @param string $widget_id  ID of the widget marked for deletion.
166            * @param string $sidebar_id ID of the sidebar the widget was deleted from.
167            * @param string $id_base    ID base for the widget.
168            */
169           do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
170      }
171
172      $_POST['widget-id'] = $sidebar;
173
174      foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
175           if ( $name !== $id_base || ! is_callable( $control['callback'] ) ) {
176                continue;
177           }
178