WC_Order_Item_Product::get_item_download_url( int $download_id )

Get the Download URL.


Description Description


Parameters Parameters

$download_id

(Required) Download ID.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-wc-order-item-product.php

	public function get_item_download_url( $download_id ) {
		$order = $this->get_order();

		return $order ? add_query_arg(
			array(
				'download_file' => $this->get_variation_id() ? $this->get_variation_id() : $this->get_product_id(),
				'order'         => $order->get_order_key(),
				'email'         => rawurlencode( $order->get_billing_email() ),
				'key'           => $download_id,
			),
			trailingslashit( home_url() )
		) : '';
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.