woocommerce_bulk_action_ids
Allows 3rd parties to modify order IDs about to be affected by a bulk action.
Использование
add_filter( 'woocommerce_bulk_action_ids', 'wp_kama_woocommerce_bulk_action_ids_filter', 10, 3 ); /** * Function for `woocommerce_bulk_action_ids` filter-hook. * * @param array $ids Array of order IDs. * @param $action * @param $string * * @return array */ function wp_kama_woocommerce_bulk_action_ids_filter( $ids, $action, $string ){ // filter... return $ids; }
- $ids(массив)
- Array of order IDs.
- $action
- -
- $string
- -
Где вызывается хук
woocommerce_bulk_action_ids
woocommerce/src/Internal/Admin/Orders/ListTable.php 1325-1330
$ids = apply_filters( // phpcs:ignore WooCommerce.Commenting.CommentHooks.MissingSinceComment 'woocommerce_bulk_action_ids', $ids, $action, 'order' );
woocommerce/includes/admin/list-tables/class-wc-admin-list-table-orders.php 451
$ids = apply_filters( 'woocommerce_bulk_action_ids', array_reverse( array_map( 'absint', $ids ) ), $action, 'order' );