updated plugin Easy Digital Downloads version 3.1.1.2

This commit is contained in:
2023-03-17 22:34:04 +00:00
committed by Gitium
parent e8a66564bd
commit 19e086d1c4
647 changed files with 20986 additions and 27305 deletions

View File

@ -356,9 +356,6 @@ function edd_ajax_generate_file_download_link() {
die( '-3' );
}
$payment_key = edd_get_payment_key( $payment_id );
$email = edd_get_payment_user_email( $payment_id );
$limit = edd_get_file_download_limit( $download_id );
if ( ! empty( $limit ) ) {
// Increase the file download limit when generating new links
@ -370,10 +367,10 @@ function edd_ajax_generate_file_download_link() {
die( '-4' );
}
$order = edd_get_order( $payment_id );
$file_urls = '';
foreach( $files as $file_key => $file ) {
$file_urls .= edd_get_download_file_url( $payment_key, $email, $file_key, $download_id, $price_id );
foreach ( $files as $file_key => $file ) {
$file_urls .= edd_get_download_file_url( $order, $order->email, $file_key, $download_id, $price_id );
$file_urls .= "\n\n";
}
@ -587,15 +584,18 @@ function edd_orders_list_table_process_bulk_actions() {
_doing_it_wrong( __FUNCTION__, 'This method is not meant to be called directly.', 'EDD 3.0' );
}
// Check the current user's capability.
if ( ! current_user_can( 'edit_shop_payments' ) ) {
return;
}
$action = isset( $_REQUEST['action'] ) // WPCS: CSRF ok.
? sanitize_text_field( $_REQUEST['action'] )
: '';
// If this is a 'delete' action, the capability changes from edit to delete.
$cap = 'delete' === $action ? 'delete_shop_payments' : 'edit_shop_payments';
// Check the current user's capability.
if ( ! current_user_can( $cap ) ) {
return;
}
// Bail if we aren't processing bulk actions.
if ( '-1' === $action ) {
return;
@ -625,6 +625,9 @@ function edd_orders_list_table_process_bulk_actions() {
case 'restore':
edd_restore_order( $id );
break;
case 'delete':
edd_destroy_order( $id );
break;
case 'set-status-complete':
edd_update_payment_status( $id, 'complete' );
break;

View File

@ -368,7 +368,27 @@ class EDD_Payment_History_Table extends List_Table {
return;
}
}
esc_html_e( 'No orders found.', 'easy-digital-downloads' );
$status = $this->get_status();
if ( ! empty( $status ) ) {
$status_label = edd_get_status_label( $status );
switch ( $status ) {
case 'trash':
/* Translators: %s is for the status of 'Trash', telling the user no items were found in the trash. */
$message = sprintf( __( 'No orders found in %s.', 'easy-digital-downloads' ), $status_label );
break;
default:
/* Translators: %s is for the currently viewed order status filter */
$message = sprintf( __( 'No %s orders found.', 'easy-digital-downloads' ), $status_label );
break;
}
echo esc_html( $message );
} else {
esc_html_e( 'No orders found.', 'easy-digital-downloads' );
}
}
/**
@ -509,7 +529,7 @@ class EDD_Payment_History_Table extends List_Table {
public function column_number( $order ) {
$status = $this->get_status();
// View URL
// View URL.
$view_url = edd_get_admin_url( array(
'page' => 'edd-payment-history',
'view' => 'sale' === $order->type
@ -518,13 +538,13 @@ class EDD_Payment_History_Table extends List_Table {
'id' => absint( $order->id ),
) );
// Default row actions
// Default row actions.
$row_actions = array(
'view' => '<a href="' . esc_url( $view_url ) . '">' . esc_html__( 'Edit', 'easy-digital-downloads' ) . '</a>',
);
// View receipt
if ( 'sale' === $order->type && edd_can_view_receipt( $order->payment_key ) ) {
// View receipt.
if ( 'sale' === $order->type && edd_can_view_receipt( $order ) ) {
$row_actions['receipt'] = sprintf(
'<a href="%s" target="_blank">%s</a>',
edd_get_receipt_page_uri( $order->id ),
@ -532,7 +552,7 @@ class EDD_Payment_History_Table extends List_Table {
);
}
// Resend Receipt
// Resend Receipt.
if ( 'sale' === $this->type && 'complete' === $order->status && ! empty( $order->email ) ) {
$row_actions['email_links'] = '<a href="' . esc_url( add_query_arg( array(
'edd-action' => 'email_links',
@ -540,7 +560,7 @@ class EDD_Payment_History_Table extends List_Table {
), $this->base_url ) ) . '">' . __( 'Resend Receipt', 'easy-digital-downloads' ) . '</a>';
}
// Keep Delete at the end
// Keep Delete at the end.
if ( edd_is_order_trashable( $order->id ) ) {
$trash_url = wp_nonce_url( add_query_arg( array(
'edd-action' => 'trash_order',
@ -677,6 +697,10 @@ class EDD_Payment_History_Table extends List_Table {
$action = array(
'restore' => __( 'Restore', 'easy-digital-downloads' ),
);
if ( current_user_can( 'delete_shop_payments' ) ) {
$action['delete'] = __( 'Delete permanently', 'easy-digital-downloads' );
}
} else {
$action['trash'] = __( 'Move to Trash', 'easy-digital-downloads' );
}
@ -1064,12 +1088,19 @@ class EDD_Payment_History_Table extends List_Table {
*
* @param string $which
* @since 3.1.0.4
* @since 3.1.1 Outputs the dialogs for deleting orders.
*/
protected function display_tablenav( $which ) {
if ( 'top' === $which ) {
if ( 'top' === $which ) :
wp_nonce_field( 'bulk-' . $this->_args['plural'], '_wpnonce', false );
}
?>
?>
<div id="edd-bulk-delete-dialog" class="edd-dialog" title="<?php esc_html_e( 'Confirmation Required', 'easy-digital-downloads' ); ?>">
<?php esc_html_e( 'You are about to permanently delete orders from your store. Once deleted, these orders are not recoverable. Are you sure you want to continue?', 'easy-digital-downloads' ); ?>
</div>
<div id="edd-single-delete-dialog" class="edd-dialog" title="<?php esc_html_e( 'Confirmation Required', 'easy-digital-downloads' ); ?>">
<?php esc_html_e( 'You are about to permanently delete this order from your store. Once deleted, this order is not recoverable. Are you sure you want to continue?', 'easy-digital-downloads' ); ?>
</div>
<?php endif; ?>
<div class="tablenav <?php echo esc_attr( $which ); ?>">
<?php if ( $this->has_items() ) : ?>