woocommerce_(order_type)_list_table_order_count хук-фильтрWC 7.3.0

Allows 3rd parties to modify the count of orders by status.

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

add_filter( 'woocommerce_(order_type)_list_table_order_count', 'wp_kama_woocommerce_order_type_list_table_count_filter', 10, 2 );

/**
 * Function for `woocommerce_(order_type)_list_table_order_count` filter-hook.
 * 
 * @param int      $count  Number of orders for the given status.
 * @param string[] $status List of order statuses in the count.
 *
 * @return int
 */
function wp_kama_woocommerce_order_type_list_table_count_filter( $count, $status ){

	// filter...
	return $count;
}
$count(int)
Number of orders for the given status.
$status(string[])
List of order statuses in the count.

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

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

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

ListTable::count_orders_by_status()
woocommerce_(order_type)_list_table_order_count
woocommerce/src/Internal/Admin/Orders/ListTable.php 524-528
return apply_filters(
	'woocommerce_' . $this->order_type . '_list_table_order_count',
	$count,
	$status
);

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

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