woocommerce_order_downloads_table_show_downloads filter-hookWC 8.5.0

Determines if the order downloads table should be shown (in the context of the order details template).

By default, this is true if the order has at least one dowloadable items and download is permitted (which is partly determined by the order status). For special cases, though, this can be overridden and the downloads table can be forced to render (or forced not to render).

Usage

add_filter( 'woocommerce_order_downloads_table_show_downloads', 'wp_kama_woocommerce_order_downloads_table_show_filter', 10, 2 );

/**
 * Function for `woocommerce_order_downloads_table_show_downloads` filter-hook.
 * 
 * @param bool     $show_downloads If the downloads table should be shown.
 * @param WC_Order $order          The related order.
 *
 * @return bool
 */
function wp_kama_woocommerce_order_downloads_table_show_filter( $show_downloads, $order ){

	// filter...
	return $show_downloads;
}
$show_downloads(true|false)
If the downloads table should be shown.
$order(WC_Order)
The related order.

Changelog

Since 8.5.0 Introduced.

Where the hook is called

woocommerce_order_details_table()
woocommerce_order_downloads_table_show_downloads
woocommerce/includes/wc-template-functions.php 2766
'show_downloads' => apply_filters( 'woocommerce_order_downloads_table_show_downloads', ( $order->has_downloadable_item() && $order->is_download_permitted() ), $order ),

Where the hook is used in WooCommerce

Usage not found.