handle_bulk_actions-(screen_id) хук-фильтрWC 7.2.0

This action is documented in /wp-admin/edit.php (it is a core WordPress hook).

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

add_filter( 'handle_bulk_actions-(screen_id)', 'wp_kama_handle_bulk_actions_screen_id_filter', 10, 3 );

/**
 * Function for `handle_bulk_actions-(screen_id)` filter-hook.
 * 
 * @param string $redirect_to The URL to redirect to after processing the bulk actions.
 * @param string $action      The current bulk action.
 * @param int[]  $ids         IDs for the orders to be processed.
 *
 * @return string
 */
function wp_kama_handle_bulk_actions_screen_id_filter( $redirect_to, $action, $ids ){

	// filter...
	return $redirect_to;
}
$redirect_to(строка)
The URL to redirect to after processing the bulk actions.
$action(строка)
The current bulk action.
$ids(int[])
IDs for the orders to be processed.

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

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

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

ListTable::handle_bulk_actions()
handle_bulk_actions-(screen_id)
woocommerce/src/Internal/Admin/Orders/ListTable.php 1318
$custom_sendback = apply_filters( "handle_bulk_actions-{$screen}", $redirect_to, $action, $ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores

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

woocommerce/includes/admin/list-tables/abstract-class-wc-admin-list-table.php 52
add_filter( 'handle_bulk_actions-edit-' . $this->list_table_type, array( $this, 'handle_bulk_actions' ), 10, 3 );