WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
This hook occurs 2 times in this file.
Line | Code |
---|---|
2288 | } |
2289 |
|
2290 | unset( $_POST['savewidgets'], $_POST['action'] ); |
2291 |
|
2292 | /** |
2293 | * Fires early when editing the widgets displayed in sidebars. |
2294 | * |
2295 | * @since 2.8.0 |
2296 | */ |
2297 | do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
2298 |
|
2299 | /** |
2300 | * Fires early when editing the widgets displayed in sidebars. |
2301 | * |
2302 | * @since 2.8.0 |
2303 | */ |
2304 | do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
2305 |
|
2306 | /** This action is documented in wp-admin/widgets.php */ |
Line | Code |
2398 | function wp_ajax_delete_inactive_widgets() { |
2399 | check_ajax_referer( 'remove-inactive-widgets', 'removeinactivewidgets' ); |
2400 |
|
2401 | if ( ! current_user_can( 'edit_theme_options' ) ) { |
2402 | wp_die( -1 ); |
2403 | } |
2404 |
|
2405 | unset( $_POST['removeinactivewidgets'], $_POST['action'] ); |
2406 | /** This action is documented in wp-admin/includes/ajax-actions.php */ |
2407 | do_action( 'load-widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
2408 | /** This action is documented in wp-admin/includes/ajax-actions.php */ |
2409 | do_action( 'widgets.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
2410 | /** This action is documented in wp-admin/widgets.php */ |
2411 | do_action( 'sidebar_admin_setup' ); |
2412 |
|
2413 | $sidebars_widgets = wp_get_sidebars_widgets(); |
2414 |
|
2415 | foreach ( $sidebars_widgets['wp_inactive_widgets'] as $key => $widget_id ) { |
2416 | $pieces = explode( '-', $widget_id ); |