delete_widget хук-событиеWP 4.4.0

Fires immediately after a widget has been marked for deletion.

Использование

add_action( 'delete_widget', 'wp_kama_delete_widget_action', 10, 3 );

/**
 * Function for `delete_widget` action-hook.
 * 
 * @param string $widget_id  ID of the widget marked for deletion.
 * @param string $sidebar_id ID of the sidebar the widget was deleted from.
 * @param string $id_base    ID base for the widget.
 *
 * @return void
 */
function wp_kama_delete_widget_action( $widget_id, $sidebar_id, $id_base ){

	// action...
}
$widget_id(строка)
ID of the widget marked for deletion.
$sidebar_id(строка)
ID of the sidebar the widget was deleted from.
$id_base(строка)
ID base for the widget.

Список изменений

С версии 4.4.0 Введена.

Где вызывается хук

В файле: /wp-admin/widgets-form.php
delete_widget
wp-admin/widgets-form.php 169
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.php 413
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );
wp-admin/includes/ajax-actions.php 2374
do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base );

Где используется хук в WordPress

Использование не найдено.