updated plugin Easy Digital Downloads
version 3.1.1.4.2
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
$price_id = $item->price_id;
|
||||
$download_files = edd_get_download_files( $item->product_id, $item->price_id );
|
||||
if ( $block_attributes['hide_empty'] && empty( $download_files ) ) {
|
||||
return;
|
||||
@ -12,28 +11,49 @@ $classes = array(
|
||||
if ( $block_attributes['search'] && edd_is_pro() ) {
|
||||
$classes[] = 'edd-pro-search__product';
|
||||
}
|
||||
|
||||
$registered_columns = EDD\Blocks\Orders\get_user_downloads_block_columns();
|
||||
?>
|
||||
<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
|
||||
<div class="edd-blocks__row-label"><?php echo esc_html( $name ); ?></div>
|
||||
<?php
|
||||
foreach ( $registered_columns as $column_id => $column ) {
|
||||
$row = $column['row'];
|
||||
|
||||
<?php if ( ! edd_no_redownload() ) : ?>
|
||||
<div class="edd-order-item__files">
|
||||
$classes = array(
|
||||
'edd-blocks__row-column',
|
||||
'edd-blocks__row-column--' . $column_id,
|
||||
);
|
||||
|
||||
if ( ! empty( $row['classes'] ) ) {
|
||||
$classes = array_merge( $classes, $row['classes'] );
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="<?php echo esc_attr( implode( ' ', array_filter( $classes ) ) ); ?>">
|
||||
<?php
|
||||
if ( $download_files ) :
|
||||
foreach ( $download_files as $filekey => $file ) :
|
||||
$download_url = edd_get_download_file_url( $order, $order->email, $filekey, $item->product_id, $price_id );
|
||||
?>
|
||||
<div class="edd-order-item__file">
|
||||
<a href="<?php echo esc_url( $download_url ); ?>" class="edd-order-item__file-link">
|
||||
<?php echo esc_html( edd_get_file_name( $file ) ); ?>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
||||
else :
|
||||
echo esc_html( $block_attributes['nofiles'] );
|
||||
endif; // End $download_files
|
||||
|
||||
$action_args = array(
|
||||
'name' => $name,
|
||||
'order_item' => $item,
|
||||
'order' => $order,
|
||||
'block_attributes' => $block_attributes,
|
||||
'download_files' => $download_files,
|
||||
);
|
||||
/**
|
||||
* Renders a column in the user downloads block.
|
||||
*
|
||||
* To add a new column, use the `edd_blocks_user_download_columns` filter.
|
||||
*
|
||||
* @since 2.0.6
|
||||
* @param array $action_args The arguments to pass to the hook.
|
||||
* @param string $name The name of the product.
|
||||
* @param EDD\Orders\Order_Item $item The order item.
|
||||
* @param EDD\Orders\Order $order The order object.
|
||||
* @param array $block_attributes The block attributes.
|
||||
* @param array $download_files The download files.
|
||||
*/
|
||||
do_action( 'edd_blocks_user_downloads_block_column_' . $column_id, $action_args );
|
||||
?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user