WordPress at Your Fingertips
function is not described

WC_Abstract_Legacy_Order::display_item_downloads() public WC 1.0

Display download links for an order item.

{} It's a method of the class: WC_Abstract_Legacy_Order{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Abstract_Legacy_Order = new WC_Abstract_Legacy_Order();
$WC_Abstract_Legacy_Order->display_item_downloads( $item );
$item(array) (required)
-

Code of WC_Abstract_Legacy_Order::display_item_downloads() WC 5.6.0

public function display_item_downloads( $item ) {
	wc_deprecated_function( 'WC_Order::display_item_downloads', '3.0', 'wc_display_item_downloads' );
	$product   = $item->get_product();

	if ( $product && $product->exists() && $product->is_downloadable() && $this->is_download_permitted() ) {
		$download_files = $this->get_item_downloads( $item );
		$i			  = 0;
		$links		  = array();

		foreach ( $download_files as $download_id => $file ) {
			$i++;
			/* translators: 1: current item count */
			$prefix  = count( $download_files ) > 1 ? sprintf( __( 'Download %d', 'woocommerce' ), $i ) : __( 'Download', 'woocommerce' );
			$links[] = '<small class="download-url">' . esc_html( $prefix ) . ': <a href="' . esc_url( $file['download_url'] ) . '" target="_blank">' . esc_html( $file['name'] ) . '</a></small>' . "\n";
		}

		echo '<br/>' . implode( '<br/>', $links );
	}
}