Make customer download links available for admins

This commit is contained in:
Caleb Burks 2016-05-10 23:52:18 -05:00
parent cae8056172
commit 2fd455769d
1 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,19 @@ if ( ! defined( 'ABSPATH' ) ) {
<label><?php _e( 'Access expires', 'woocommerce' ); ?></label>
<input type="text" class="short date-picker" name="access_expires[<?php echo $loop; ?>]" value="<?php echo $download->access_expires > 0 ? date_i18n( 'Y-m-d', strtotime( $download->access_expires ) ) : ''; ?>" maxlength="10" placeholder="<?php esc_attr_e( 'Never', 'woocommerce' ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />
</td>
<td>
<label><?php _e( 'Customer download link', 'woocommerce' ); ?></label>
<?php
$download_link = add_query_arg( array(
'download_file' => $download->product_id,
'order' => $download->order_key,
'email' => urlencode( $download->user_email ),
'key' => $download->download_id
), trailingslashit( home_url() ) );
echo '<a href="' . $download_link . '">' . $file_count . '</a>';
?>
</td>
</tr>
</tbody>
</table>