woocommerce_get_item_downloads
Filters the list of downloadable files for an order item.
Использование
add_filter( 'woocommerce_get_item_downloads', 'wp_kama_woocommerce_get_item_downloads_filter', 10, 3 );
/**
* Function for `woocommerce_get_item_downloads` filter-hook.
*
* @param array $files Array of downloadable file data.
* @param WC_Order_Item_Product $item The order item product object.
* @param WC_Order $order The order object.
*
* @return array
*/
function wp_kama_woocommerce_get_item_downloads_filter( $files, $item, $order ){
// filter...
return $files;
}
- $files(массив)
- Array of downloadable file data.
- $item(WC_Order_Item_Product)
- The order item product object.
- $order(WC_Order)
- The order object.
Список изменений
| С версии 2.7.0 | Введена. |
Где вызывается хук
woocommerce_get_item_downloads
woocommerce/includes/class-wc-order-item-product.php 473
return apply_filters( 'woocommerce_get_item_downloads', $files, $this, $order );