updated plugin Easy Digital Downloads
version 3.1.4
This commit is contained in:
@ -89,8 +89,9 @@ function edd_maybe_add_store_mode_admin_bar_menu( $wp_admin_bar ) {
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'parent' => 'edd-store-menu',
|
||||
'id' => 'edd-store-prodcuts',
|
||||
/* translators: plural downlaods label */
|
||||
'title' => sprintf( __( 'All %1$s', 'easy-digital-downloads' ), edd_get_label_plural() ),
|
||||
'href' => edd_get_admin_url(),
|
||||
'href' => edd_get_admin_url(),
|
||||
) );
|
||||
|
||||
// String.
|
||||
@ -106,8 +107,9 @@ function edd_maybe_add_store_mode_admin_bar_menu( $wp_admin_bar ) {
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'parent' => 'edd-store-menu',
|
||||
'id' => 'edd-store-status',
|
||||
/* translators: %s: store status ("Test Mode" or "Live Mode") */
|
||||
'title' => sprintf( __( 'Store Status: %s', 'easy-digital-downloads' ), '<span class="edd-mode edd-mode-' . esc_attr( $mode ) . '">' . $text . '</span>' ),
|
||||
'href' => edd_get_admin_url(
|
||||
'href' => edd_get_admin_url(
|
||||
array(
|
||||
'page' => 'edd-settings',
|
||||
'tab' => 'gateways',
|
||||
@ -140,9 +142,10 @@ function edd_maybe_add_store_mode_admin_bar_menu( $wp_admin_bar ) {
|
||||
if ( ! empty( $is_dev ) ) {
|
||||
$wp_admin_bar->add_menu( array(
|
||||
'id' => 'edd-is-dev',
|
||||
/* translators: %s: Whether this is a development domain (1 for true, 0 for false) */
|
||||
'title' => sprintf( __( 'Development Domain %s', 'easy-digital-downloads' ), '<span class="edd-mode">' . $is_dev . '</span>' ),
|
||||
'parent' => 'edd-store-menu',
|
||||
'href' => edd_get_admin_url(
|
||||
'href' => edd_get_admin_url(
|
||||
array(
|
||||
'page' => 'edd-settings',
|
||||
'tab' => 'gateways',
|
||||
|
@ -23,8 +23,10 @@ if( !defined( 'ABSPATH' ) ) exit;
|
||||
function edd_admin_rate_us( $footer_text ) {
|
||||
global $typenow;
|
||||
|
||||
if ( $typenow == 'download' ) {
|
||||
$rate_text = sprintf( __( 'Thank you for using <a href="%1$s" target="_blank">Easy Digital Downloads</a>! Please <a href="%2$s" target="_blank">rate us on WordPress.org</a>', 'easy-digital-downloads' ),
|
||||
if ( 'download' === $typenow ) {
|
||||
$rate_text = sprintf(
|
||||
/* translators: 1. link to EDD site; 2. link to wordpress.org to review */
|
||||
__( 'Thank you for using <a href="%1$s" target="_blank">Easy Digital Downloads</a>! Please <a href="%2$s" target="_blank">rate us on WordPress.org</a>', 'easy-digital-downloads' ),
|
||||
'https://easydigitaldownloads.com',
|
||||
'https://wordpress.org/support/plugin/easy-digital-downloads/reviews/?rate=5#new-post'
|
||||
);
|
||||
|
@ -269,9 +269,10 @@ class EDD_Notices {
|
||||
if ( empty( $purchase_page ) || ( 'trash' === get_post_status( $purchase_page ) ) ) {
|
||||
$this->add_notice( array(
|
||||
'id' => 'edd-no-purchase-page',
|
||||
/* translators: %s: URL to the settings page */
|
||||
'message' => sprintf( __( 'No checkout page is configured. Set one in <a href="%s">Settings</a>.', 'easy-digital-downloads' ), esc_url( edd_get_admin_url( array( 'page' => 'edd-settings', 'tab' => 'general', 'section' => 'pages' ) ) ) ),
|
||||
'class' => 'error',
|
||||
'is_dismissible' => false
|
||||
'is_dismissible' => false,
|
||||
) );
|
||||
}
|
||||
}
|
||||
@ -324,8 +325,10 @@ class EDD_Notices {
|
||||
'class' => 'error',
|
||||
'is_dismissible' => false,
|
||||
'message' => array(
|
||||
/* translators: %s: Uploads directory */
|
||||
sprintf( __( 'The files in %s are not currently protected.', 'easy-digital-downloads' ), '<code>' . $upload_directory . '</code>' ),
|
||||
__( 'To protect them, you must add this <a href="https://easydigitaldownloads.com/docs/download-files-not-protected-on-nginx/">NGINX redirect rule</a>.', 'easy-digital-downloads' ),
|
||||
/* translators: %s: Dismiss notice URL */
|
||||
sprintf( __( 'If you have already done this, or it does not apply to your site, you may permenently %s.', 'easy-digital-downloads' ), '<a href="' . esc_url( $dismiss_notice_url ) . '">' . __( 'dismiss this notice', 'easy-digital-downloads' ) . '</a>' )
|
||||
)
|
||||
) );
|
||||
@ -366,7 +369,8 @@ class EDD_Notices {
|
||||
'class' => 'error',
|
||||
'is_dismissible' => false,
|
||||
'message' => sprintf(
|
||||
__( 'Easy Digital Downloads 2.5 contains a <a href="%s">built in recount tool</a>. Please <a href="%s">deactivate the Easy Digital Downloads - Recount Earnings plugin</a>', 'easy-digital-downloads' ),
|
||||
/* translators: 1. link to the recount tool; 2. link to the plugins screen. */
|
||||
__( 'Easy Digital Downloads 2.5 contains a <a href="%1$s">built in recount tool</a>. Please <a href="%2$s">deactivate the Easy Digital Downloads - Recount Earnings plugin</a>', 'easy-digital-downloads' ),
|
||||
esc_url( edd_get_admin_url( array( 'page' => 'edd-tools', 'tab' => 'general' ) ) ),
|
||||
esc_url( admin_url( 'plugins.php' ) )
|
||||
)
|
||||
@ -433,6 +437,24 @@ class EDD_Notices {
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ( 'accounting' === filter_input( INPUT_GET, 'section', FILTER_SANITIZE_STRING ) ) {
|
||||
if ( ! empty( edd_get_option( 'sequential_start_update_failed', false ) ) ) {
|
||||
$order_number = new \EDD\Orders\Number();
|
||||
$this->add_notice(
|
||||
array(
|
||||
'id' => 'edd-sequential-order-numbers-not-updated',
|
||||
'message' => sprintf(
|
||||
/* translators: %s: Next order number */
|
||||
__( 'The sequential starting number could not be updated because it could conflict with existing orders. The next assigned order number is %s.', 'easy-digital-downloads' ),
|
||||
'<code>' . $order_number->format( (int) get_option( 'edd_next_order_number' ) ) . '</code>'
|
||||
),
|
||||
'class' => 'error',
|
||||
)
|
||||
);
|
||||
edd_delete_option( 'sequential_start_update_failed' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -66,12 +66,14 @@ function edd_edit_customer( $args = array() ) {
|
||||
|
||||
// Make sure we don't already have this user attached to a customer
|
||||
if ( ! empty( $customer_info['user_id'] ) && false !== edd_get_customer_by( 'user_id', $customer_info['user_id'] ) ) {
|
||||
/* translators: %d: user ID */
|
||||
edd_set_error( 'edd-invalid-customer-user_id', sprintf( __( 'The User ID %d is already associated with a different customer.', 'easy-digital-downloads' ), $customer_info['user_id'] ) );
|
||||
}
|
||||
|
||||
// Make sure it's actually a user
|
||||
$user = get_user_by( 'id', $customer_info['user_id'] );
|
||||
if ( ! empty( $customer_info['user_id'] ) && false === $user ) {
|
||||
/* translators: %d: user ID */
|
||||
edd_set_error( 'edd-invalid-user_id', sprintf( __( 'The User ID %d does not exist. Please assign an existing user.', 'easy-digital-downloads' ), $customer_info['user_id'] ) );
|
||||
}
|
||||
}
|
||||
@ -98,6 +100,7 @@ function edd_edit_customer( $args = array() ) {
|
||||
if ( $user ) {
|
||||
$user_id = $user->ID;
|
||||
} else {
|
||||
/* translators: %s: user login or email address */
|
||||
edd_set_error( 'edd-invalid-user-string', sprintf( __( 'Failed to attach user. The login or email address %s was not found.', 'easy-digital-downloads' ), $customer_info['user_login'] ) );
|
||||
}
|
||||
}
|
||||
@ -259,13 +262,15 @@ function edd_add_customer_email( $args = array() ) {
|
||||
'redirect' => $redirect . '#edd_general_emails',
|
||||
);
|
||||
|
||||
$user = wp_get_current_user();
|
||||
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
|
||||
$customer_note = sprintf( __( 'Email address %s added by %s', 'easy-digital-downloads' ), $email, $user_login );
|
||||
$user = wp_get_current_user();
|
||||
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
|
||||
/* translators: 1. email address; 2. username */
|
||||
$customer_note = sprintf( __( 'Email address %1$s added by %2$s', 'easy-digital-downloads' ), $email, $user_login );
|
||||
$customer->add_note( $customer_note );
|
||||
|
||||
if ( $primary ) {
|
||||
$customer_note = sprintf( __( 'Email address %s set as primary by %s', 'easy-digital-downloads' ), $email, $user_login );
|
||||
/* translators: 1. email address; 2. username */
|
||||
$customer_note = sprintf( __( 'Email address %1$s set as primary by %2$s', 'easy-digital-downloads' ), $email, $user_login );
|
||||
$customer->add_note( $customer_note );
|
||||
}
|
||||
}
|
||||
@ -320,9 +325,10 @@ function edd_remove_customer_email() {
|
||||
'edd-message' => 'email-removed',
|
||||
)
|
||||
);
|
||||
$user = wp_get_current_user();
|
||||
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
|
||||
$customer_note = sprintf( __( 'Email address %s removed by %s', 'easy-digital-downloads' ), sanitize_email( $_GET['email'] ), $user_login );
|
||||
$user = wp_get_current_user();
|
||||
$user_login = ! empty( $user->user_login ) ? $user->user_login : edd_get_bot_name();
|
||||
/* translators: 1. email address; 2. username */
|
||||
$customer_note = sprintf( __( 'Email address %1$s removed by %2$s', 'easy-digital-downloads' ), sanitize_email( $_GET['email'] ), $user_login );
|
||||
$customer->add_note( $customer_note );
|
||||
|
||||
} else {
|
||||
|
@ -104,8 +104,9 @@ function edd_maybe_remove_menu_profile_links() {
|
||||
|
||||
if ( edd_user_pending_verification() ) {
|
||||
|
||||
if( defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE ) {
|
||||
$url = esc_url( edd_get_user_verification_request_url() );
|
||||
if ( defined( 'IS_PROFILE_PAGE' ) && true === IS_PROFILE_PAGE ) {
|
||||
$url = esc_url( edd_get_user_verification_request_url() );
|
||||
/* translators: link to send an email */
|
||||
$message = sprintf( __( 'Your account is pending verification. Please click the link in your email to activate your account. No email? <a href="%s">Click here</a> to send a new activation code.', 'easy-digital-downloads' ), esc_url( $url ) );
|
||||
$title = __( 'Account Pending Verification', 'easy-digital-downloads' );
|
||||
$args = array(
|
||||
|
@ -256,6 +256,7 @@ function edd_customers_list( $active_tab = 'customers' ) {
|
||||
<form id="edd-customers-filter" method="get" action="<?php echo esc_url( $action_url ); ?>">
|
||||
<?php
|
||||
$customers_table->views();
|
||||
/* translators: the active screen, eg "Search Customers" or "Search Customer Email Addresses" */
|
||||
$customers_table->search_box( sprintf( __( 'Search %s', 'easy-digital-downloads' ), $name ), 'edd-customers' );
|
||||
$customers_table->display();
|
||||
?>
|
||||
@ -560,6 +561,7 @@ function edd_customers_view( $customer = null ) {
|
||||
|
||||
<span data-key="user_id">
|
||||
<?php if ( empty( $user_login ) ) :
|
||||
/* translators: %s: user id */
|
||||
printf( __( 'User %s missing', 'easy-digital-downloads' ), '<code>' . esc_html( $user_id ) . '</code>');
|
||||
endif; ?>
|
||||
<a href="<?php echo esc_url( admin_url( 'user-edit.php?user_id=' . absint( $user_id ) ) ); ?>"><?php echo esc_html( $user_login ); ?></a>
|
||||
@ -776,7 +778,12 @@ function edd_customers_view( $customer = null ) {
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3><?php printf( __( 'Purchased %s', 'easy-digital-downloads' ), edd_get_label_plural() ); ?></h3>
|
||||
<h3>
|
||||
<?php
|
||||
/* translators: %s: plural downloads label */
|
||||
printf( esc_html__( 'Purchased %s', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) );
|
||||
?>
|
||||
</h3>
|
||||
<table class="wp-list-table widefat striped customer-downloads">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -796,7 +803,12 @@ function edd_customers_view( $customer = null ) {
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<tr><td class="no-items"><?php printf( __( 'No %s Found', 'easy-digital-downloads' ), edd_get_label_plural() ); ?></td></tr>
|
||||
<tr><td class="no-items">
|
||||
<?php
|
||||
/* translators: %s: plural downloads label */
|
||||
printf( esc_html__( 'No %s Found', 'easy-digital-downloads' ), esc_html( edd_get_label_plural() ) );
|
||||
?>
|
||||
</td></tr>
|
||||
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
|
@ -96,9 +96,13 @@ function edd_admin_add_discount( $data = array() ) {
|
||||
? intval( $data['start_date_minute'] )
|
||||
: '00';
|
||||
|
||||
$start_date_string = EDD()->utils->get_date_string(
|
||||
$start_date,
|
||||
$start_date_hour,
|
||||
$start_date_minute
|
||||
);
|
||||
// The start date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $start_date . ' ' . $start_date_hour . ':' . $start_date_minute . ':00', edd_get_timezone_id(), false ) );
|
||||
$to_add['start_date'] = $date->format( 'Y-m-d H:i:s' );
|
||||
$to_add['start_date'] = edd_get_utc_date_string( $start_date_string );
|
||||
}
|
||||
|
||||
// End date.
|
||||
@ -111,9 +115,13 @@ function edd_admin_add_discount( $data = array() ) {
|
||||
? intval( $data['end_date_minute'] )
|
||||
: '59';
|
||||
|
||||
$end_date_string = EDD()->utils->get_date_string(
|
||||
$end_date,
|
||||
$end_date_hour,
|
||||
$end_date_minute,
|
||||
);
|
||||
// The end date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $end_date . ' ' . $end_date_hour . ':' . $end_date_minute . ':00', edd_get_timezone_id(), false ) );
|
||||
$to_add['end_date'] = $date->format( 'Y-m-d H:i:s' );
|
||||
$to_add['end_date'] = edd_get_utc_date_string( $end_date_string );
|
||||
}
|
||||
|
||||
// Meta values.
|
||||
@ -229,9 +237,14 @@ function edd_admin_edit_discount( $data = array() ) {
|
||||
? intval( $data['start_date_minute'] )
|
||||
: '00';
|
||||
|
||||
$start_date_string = EDD()->utils->get_date_string(
|
||||
$start_date,
|
||||
$start_date_hour,
|
||||
$start_date_minute,
|
||||
);
|
||||
|
||||
// The start date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $start_date . ' ' . $start_date_hour . ':' . $start_date_minute . ':00', edd_get_timezone_id(), false ) );
|
||||
$to_update['start_date'] = $date->format( 'Y-m-d H:i:s' );
|
||||
$to_update['start_date'] = edd_get_utc_date_string( $start_date_string );
|
||||
} else {
|
||||
$to_update['start_date'] = null;
|
||||
}
|
||||
@ -246,9 +259,14 @@ function edd_admin_edit_discount( $data = array() ) {
|
||||
? intval( $data['end_date_minute'] )
|
||||
: '59';
|
||||
|
||||
$end_date_string = EDD()->utils->get_date_string(
|
||||
$end_date,
|
||||
$end_date_hour,
|
||||
$end_date_minute
|
||||
);
|
||||
|
||||
// The end date is entered in the user's WP timezone. We need to convert it to UTC prior to saving now.
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $end_date . ' ' . $end_date_hour . ':' . $end_date_minute . ':00', edd_get_timezone_id(), false ) );
|
||||
$to_update['end_date'] = $date->format( 'Y-m-d H:i:s' );
|
||||
$to_update['end_date'] = edd_get_utc_date_string( $end_date_string );
|
||||
} else {
|
||||
$to_update['end_date'] = null;
|
||||
}
|
||||
|
@ -94,10 +94,7 @@ function edd_update_payment_details( $data = array() ) {
|
||||
);
|
||||
|
||||
// The date is entered in the WP timezone. We need to convert it to UTC prior to saving now.
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $date_string, edd_get_timezone_id(), false ) );
|
||||
$date = $date->format( 'Y-m-d H:i:s' );
|
||||
|
||||
$order_update_args['date_created'] = $date;
|
||||
$order_update_args['date_created'] = edd_get_utc_date_string( $date_string );
|
||||
|
||||
// Customer
|
||||
$curr_customer_id = sanitize_text_field( $data['current-customer-id'] );
|
||||
|
@ -879,24 +879,18 @@ class EDD_Payment_History_Table extends List_Table {
|
||||
|
||||
// Start (of day)
|
||||
if ( ! empty( $start_date ) ) {
|
||||
|
||||
$start_date_obj = EDD()->utils->date( $start_date, edd_get_timezone_id(), false )->copy()->startOfDay();
|
||||
$query_start_date = edd_get_utc_equivalent_date( $start_date_obj->copy() );
|
||||
|
||||
$args['date_query'][] = array(
|
||||
'column' => 'date_created',
|
||||
'after' => $query_start_date->format( 'mysql' ),
|
||||
'after' => edd_get_utc_date_string( $start_date, 'mysql' ),
|
||||
);
|
||||
}
|
||||
|
||||
// End (of day)
|
||||
if ( ! empty( $end_date ) ) {
|
||||
$end_date_obj = EDD()->utils->date( $end_date, edd_get_timezone_id(), false )->copy()->endOfDay();
|
||||
$query_end_date = edd_get_utc_equivalent_date( $end_date_obj->copy() );
|
||||
|
||||
$end_date_string = EDD()->utils->get_date_string( $end_date, 23, 59, 59 );
|
||||
$args['date_query'][] = array(
|
||||
'column' => 'date_created',
|
||||
'before' => $query_end_date->format( 'mysql' ),
|
||||
'column' => 'date_created',
|
||||
'before' => edd_get_utc_date_string( $end_date_string, 'mysql' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -307,6 +307,10 @@ function edd_order_details_email( $order ) {
|
||||
$customer = edd_get_customer( $order->customer_id );
|
||||
$all_emails = array( 'primary' => $customer->email );
|
||||
|
||||
if ( $customer->email !== $order->email ) {
|
||||
$all_emails['order'] = $order->email;
|
||||
}
|
||||
|
||||
foreach ( $customer->emails as $key => $email ) {
|
||||
if ( $customer->email === $email ) {
|
||||
continue;
|
||||
@ -315,59 +319,63 @@ function edd_order_details_email( $order ) {
|
||||
$all_emails[ $key ] = $email;
|
||||
}
|
||||
|
||||
$help = __( 'Send a new copy of the purchase receipt to the email address used for this order. If download URLs were included in the original receipt, new ones will be included.', 'easy-digital-downloads' );
|
||||
$help = sprintf(
|
||||
/* translators: email type */
|
||||
__('Send a new copy of the purchase receipt to the %s email address. If download URLs were included in the original receipt, new ones will be included.', 'easy-digital-downloads' ),
|
||||
count( $all_emails ) > 1 ? __( 'selected', 'easy-digital-downloads' ) : __( 'customer', 'easy-digital-downloads' )
|
||||
);
|
||||
|
||||
$is_multiselect = count( $all_emails ) > 1;
|
||||
$label_text = $is_multiselect ? __( 'Send email receipt to', 'easy-digital-downloads' ) : __( 'Email Address', 'easy-digital-downloads' );
|
||||
?>
|
||||
|
||||
<div>
|
||||
<?php
|
||||
if ( ! empty( $customer->emails ) && count( (array) $customer->emails ) > 1 ) : ?>
|
||||
<fieldset class="edd-form-group">
|
||||
<legend class="edd-form-group__label">
|
||||
<?php _e( 'Send email receipt to', 'easy-digital-downloads' ); ?>
|
||||
</legend>
|
||||
<div class="edd-form-group">
|
||||
<label class="edd-form-group__label <?php echo esc_attr( ! $is_multiselect ? 'screen-reader-text' : '' ); ?>"
|
||||
for="edd-order-receipt-email"
|
||||
>
|
||||
<?php echo esc_html( $label_text ); ?>
|
||||
</label>
|
||||
|
||||
<?php foreach ( $all_emails as $key => $email ) : ?>
|
||||
<div class="edd-form-group__control is-radio">
|
||||
<input id="<?php echo rawurlencode( sanitize_email( $email ) ); ?>" class="edd-form-group__input edd-order-resend-receipt-email" name="edd-order-resend-receipt-address" type="radio" value="<?php echo rawurlencode( sanitize_email( $email ) ); ?>" <?php checked( true, ( 'primary' === $key ) ); ?> />
|
||||
|
||||
<label for="<?php echo rawurlencode( sanitize_email( $email ) ); ?>">
|
||||
<?php echo esc_attr( $email ); ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<p class="edd-form-group__help description">
|
||||
<?php echo esc_html( $help ); ?>
|
||||
</p>
|
||||
</fieldset>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div class="edd-form-group">
|
||||
<label class="edd-form-group__label screen-reader-text" for="<?php echo esc_attr( $order->email ); ?>">
|
||||
<?php esc_html_e( 'Email Address', 'easy-digital-downloads' ); ?>
|
||||
</label>
|
||||
|
||||
<div class="edd-form-group__control">
|
||||
<input readonly type="email" id="<?php echo esc_attr( $order->email ); ?>" class="edd-form-group__input regular-text" value="<?php echo esc_attr( $order->email ); ?>" />
|
||||
</div>
|
||||
|
||||
<p class="edd-form-group__help description">
|
||||
<?php echo esc_html( $help ); ?>
|
||||
</p>
|
||||
<div class="edd-form-group__control">
|
||||
<?php if ( $is_multiselect ) : ?>
|
||||
<select class="edd-form-group__input edd-order-resend-receipt-email" name="edd-select-receipt-email" id="edd-order-receipt-email">
|
||||
<?php foreach ( $all_emails as $key => $email ) : ?>
|
||||
<option
|
||||
value="<?php echo rawurlencode( sanitize_email( $email ) ); ?>"
|
||||
<?php selected( 'primary', $key ); ?>
|
||||
>
|
||||
<?php
|
||||
echo sprintf(
|
||||
'%1$s (%2$s)',
|
||||
esc_attr( $email ),
|
||||
esc_html(
|
||||
$key === 'primary' ? __( 'Customer Primary', 'easy-digital-downloads' ) :
|
||||
(
|
||||
$key === 'order' ? __( 'Order Email', 'easy-digital-downloads' ) :
|
||||
__( 'Customer Email', 'easy-digital-downloads' )
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php else : ?>
|
||||
<input readonly type="email" id="edd-order-receipt-email" class="edd-form-group__input regular-text" value="<?php echo esc_attr( $order->email ); ?>" />
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
<p class="edd-form-group__help description">
|
||||
<?php echo esc_html( $help ); ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<a href="<?php echo esc_url( add_query_arg( array(
|
||||
'edd-action' => 'email_links',
|
||||
'purchase_id' => absint( $order->id ),
|
||||
) ) ); ?>" id="<?php if ( ! empty( $customer->emails ) && count( (array) $customer->emails ) > 1 ) {
|
||||
echo esc_attr( 'edd-select-receipt-email' );
|
||||
} else {
|
||||
echo esc_attr( 'edd-resend-receipt' );
|
||||
} ?>" class="button button-secondary"><?php esc_html_e( 'Resend Receipt', 'easy-digital-downloads' ); ?></a>
|
||||
) ) ); ?>" id="<?php echo esc_attr( 'edd-resend-receipt' ); ?>" class="button button-secondary"><?php esc_html_e( 'Resend Receipt', 'easy-digital-downloads' ); ?></a>
|
||||
</p>
|
||||
|
||||
<?php do_action( 'edd_view_order_details_resend_receipt_after', $order->id ); ?>
|
||||
@ -1121,21 +1129,45 @@ function edd_is_add_order_page() {
|
||||
* @return string
|
||||
*/
|
||||
function edd_get_order_status_badge( $order_status ) {
|
||||
|
||||
switch( $order_status ) {
|
||||
case 'refunded' :
|
||||
$icon = '<span class="edd-admin-order-status-badge__icon dashicons dashicons-undo"></span>';
|
||||
$icon = '';
|
||||
$status = $order_status;
|
||||
switch ( $order_status ) {
|
||||
case 'refunded':
|
||||
$icon = 'undo';
|
||||
break;
|
||||
case 'failed' :
|
||||
$icon = '<span class="edd-admin-order-status-badge__icon dashicons dashicons-no-alt"></span>';
|
||||
case 'failed':
|
||||
$icon = 'no-alt';
|
||||
$status = 'error';
|
||||
break;
|
||||
case 'complete' :
|
||||
$icon = '<span class="edd-admin-order-status-badge__icon dashicons dashicons-yes"></span>';
|
||||
case 'complete':
|
||||
case 'partially_refunded':
|
||||
$icon = 'yes';
|
||||
$status = 'success';
|
||||
break;
|
||||
case 'pending':
|
||||
$status = 'warning';
|
||||
break;
|
||||
default:
|
||||
$icon = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the arguments for the order status badge.
|
||||
*
|
||||
* @since 3.1.4
|
||||
* @param array $status_badge_args Array of arguments for the status badge.
|
||||
* @param string $order_status Order status slug.
|
||||
*/
|
||||
$status_badge_args = apply_filters(
|
||||
'edd_get_order_status_badge_args',
|
||||
array(
|
||||
'status' => $status,
|
||||
'label' => edd_get_payment_status_label( $order_status ),
|
||||
'icon' => $icon,
|
||||
'class' => "edd-admin-order-status-badge--{$order_status}",
|
||||
),
|
||||
$order_status
|
||||
);
|
||||
$status_badge = new EDD\Utils\StatusBadge( $status_badge_args );
|
||||
|
||||
/**
|
||||
* Filters the markup for the order status badge icon.
|
||||
*
|
||||
@ -1143,54 +1175,7 @@ function edd_get_order_status_badge( $order_status ) {
|
||||
*
|
||||
* @param string $icon Icon HTML markup.
|
||||
*/
|
||||
$icon = apply_filters( 'edd_get_order_status_badge_icon', $icon, $order_status );
|
||||
$icon = apply_filters( 'edd_get_order_status_badge_icon', $status_badge->get_icon(), $order_status );
|
||||
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<span class="edd-admin-order-status-badge edd-admin-order-status-badge--<?php echo esc_attr( $order_status ); ?>">
|
||||
|
||||
<span class="edd-admin-order-status-badge__text">
|
||||
<?php echo edd_get_payment_status_label( $order_status ); ?>
|
||||
</span>
|
||||
<span class="edd-admin-order-status-badge__icon">
|
||||
<?php
|
||||
echo wp_kses(
|
||||
$icon,
|
||||
array(
|
||||
'span' => array(
|
||||
'class' => true,
|
||||
),
|
||||
'svg' => array(
|
||||
'class' => true,
|
||||
'xmlns' => true,
|
||||
'width' => true,
|
||||
'height' => true,
|
||||
'viewbox' => true,
|
||||
'aria-hidden' => true,
|
||||
'role' => true,
|
||||
'focusable' => true,
|
||||
),
|
||||
'path' => array(
|
||||
'fill' => true,
|
||||
'fill-rule' => true,
|
||||
'd' => true,
|
||||
'transform' => true,
|
||||
),
|
||||
'polygon' => array(
|
||||
'fill' => true,
|
||||
'fill-rule' => true,
|
||||
'points' => true,
|
||||
'transform' => true,
|
||||
'focusable' => true,
|
||||
),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</span>
|
||||
|
||||
</span>
|
||||
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
return $status_badge->get( $icon );
|
||||
}
|
||||
|
@ -149,8 +149,9 @@ class EDD_File_Downloads_Log_Table extends EDD_Base_Log_List_Table {
|
||||
*/
|
||||
$file_id = apply_filters( 'edd_log_file_download_file_id', $file_id, $log );
|
||||
|
||||
$file_name = '';
|
||||
if ( ! empty( $files ) && is_numeric( $file_id ) && isset( $files[ $file_id ] ) ) {
|
||||
$file_name = edd_get_file_download_log_meta( $log->id, 'file_name', true );
|
||||
|
||||
if ( empty( $file_name ) && is_array( $files ) && isset( $files[ $file_id ] ) ) {
|
||||
$file_name = ! empty( $files[ $file_id ]['name'] )
|
||||
? $files[ $file_id ]['name']
|
||||
: edd_get_file_name( $files[ $file_id ] );
|
||||
|
@ -328,7 +328,6 @@ class EDD_Batch_Export extends EDD_Export {
|
||||
* @return array
|
||||
*/
|
||||
protected function get_date_query() {
|
||||
$time_zone = edd_get_timezone_id();
|
||||
$date_query = array(
|
||||
'after' => '',
|
||||
'before' => '',
|
||||
@ -336,13 +335,13 @@ class EDD_Batch_Export extends EDD_Export {
|
||||
);
|
||||
|
||||
if ( $this->start ) {
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $this->start . '00:00:00', $time_zone, false ) );
|
||||
$date_query['after'] = $date->format( 'Y-m-d H:i:s' );
|
||||
$start_date_string = EDD()->utils->get_date_string( $this->start );
|
||||
$date_query['after'] = edd_get_utc_date_string( $start_date_string );
|
||||
}
|
||||
|
||||
if ( $this->end ) {
|
||||
$date = edd_get_utc_equivalent_date( EDD()->utils->date( $this->end . '23:59:59', $time_zone, false ) );
|
||||
$date_query['before'] = $date->format( 'Y-m-d H:i:s' );
|
||||
$end_date_string = EDD()->utils->get_date_string( $this->end, 23, 59, 59 );
|
||||
$date_query['before'] = edd_get_utc_date_string( $end_date_string );
|
||||
}
|
||||
|
||||
return array( $date_query );
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,7 @@ function edd_media_button() {
|
||||
|
||||
// Setup the icon
|
||||
$icon = '<span class="wp-media-buttons-icon dashicons dashicons-download" id="edd-media-button"></span>';
|
||||
/* translators: singular download label */
|
||||
$text = sprintf( __( 'Insert %s', 'easy-digital-downloads' ), edd_get_label_singular() );
|
||||
|
||||
// Output the thickbox button
|
||||
|
@ -152,9 +152,19 @@ function edd_tools_recount_stats_display() {
|
||||
<option data-type="recount-store"
|
||||
value="EDD_Tools_Recount_Store_Earnings"><?php esc_html_e( 'Recount Store Earnings and Sales', 'easy-digital-downloads' ); ?></option>
|
||||
<option data-type="recount-download"
|
||||
value="EDD_Tools_Recount_Download_Stats"><?php printf( __( 'Recount Earnings and Sales for a %s', 'easy-digital-downloads' ), edd_get_label_singular( true ) ); ?></option>
|
||||
value="EDD_Tools_Recount_Download_Stats">
|
||||
<?php
|
||||
/* translators: %s: Singular download label, lowercase */
|
||||
printf( esc_html__( 'Recount Earnings and Sales for a %s', 'easy-digital-downloads' ), esc_html( edd_get_label_singular( true ) ) );
|
||||
?>
|
||||
</option>
|
||||
<option data-type="recount-all"
|
||||
value="EDD_Tools_Recount_All_Stats"><?php printf( __( 'Recount Earnings and Sales for All %s', 'easy-digital-downloads' ), edd_get_label_plural( true ) ); ?></option>
|
||||
value="EDD_Tools_Recount_All_Stats">
|
||||
<?php
|
||||
/* translators: %s: Plural download label, lowercase */
|
||||
printf( esc_html__( 'Recount Earnings and Sales for All %s', 'easy-digital-downloads' ), esc_html( edd_get_label_plural( true ) ) );
|
||||
?>
|
||||
</option>
|
||||
<option data-type="recount-customer-stats"
|
||||
value="EDD_Tools_Recount_Customer_Stats"><?php esc_html_e( 'Recount Customer Stats', 'easy-digital-downloads' ); ?></option>
|
||||
<?php do_action( 'edd_recount_tool_options' ); ?>
|
||||
@ -180,11 +190,21 @@ function edd_tools_recount_stats_display() {
|
||||
|
||||
<span class="edd-recount-stats-descriptions">
|
||||
<span id="recount-store"><?php _e( 'Recalculates the total store earnings and sales.', 'easy-digital-downloads' ); ?></span>
|
||||
<span id="recount-download"><?php printf( __( 'Recalculates the earnings and sales stats for a specific %s.', 'easy-digital-downloads' ), edd_get_label_singular( true ) ); ?></span>
|
||||
<span id="recount-all"><?php printf( __( 'Recalculates the earnings and sales stats for all %s.', 'easy-digital-downloads' ), edd_get_label_plural( true ) ); ?></span>
|
||||
<span id="recount-customer-stats"><?php _e( 'Recalculates the lifetime value and purchase counts for all customers.', 'easy-digital-downloads' ); ?></span>
|
||||
<span id="recount-download">
|
||||
<?php
|
||||
/* translators: %s: Singular wownload label, lowercase */
|
||||
printf( esc_html__( 'Recalculates the earnings and sales stats for a specific %s.', 'easy-digital-downloads' ), esc_html( edd_get_label_singular( true ) ) );
|
||||
?>
|
||||
</span>
|
||||
<span id="recount-all">
|
||||
<?php
|
||||
/* translators: %s: Pural download label, lowercase */
|
||||
printf( esc_html__( 'Recalculates the earnings and sales stats for all %s.', 'easy-digital-downloads' ), esc_html( edd_get_label_plural( true ) ) );
|
||||
?>
|
||||
</span>
|
||||
<span id="recount-customer-stats"><?php esc_html_e( 'Recalculates the lifetime value and purchase counts for all customers.', 'easy-digital-downloads' ); ?></span>
|
||||
<?php do_action( 'edd_recount_tool_descriptions' ); ?>
|
||||
<span id="reset-stats"><?php _e( '<strong>Deletes</strong> all payment records, customers, and related log entries.', 'easy-digital-downloads' ); ?></span>
|
||||
<span id="reset-stats"><?php echo wp_kses_post( __( '<strong>Deletes</strong> all payment records, customers, and related log entries.', 'easy-digital-downloads' ) ); ?></span>
|
||||
</span>
|
||||
|
||||
<span class="spinner"></span>
|
||||
@ -270,12 +290,16 @@ function edd_tools_api_keys_display() {
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
__( 'These API keys allow you to use the <a href="%s">EDD REST API</a> to retrieve store data in JSON or XML for external applications or devices, such as the <a href="%s">EDD mobile app</a>.', 'easy-digital-downloads' ),
|
||||
$docs_link,
|
||||
$ios_link
|
||||
wp_kses_post(
|
||||
/* translators: %1$s: API documentation linktag , %2$s: iOS app link tag, %3$s: closing link tag */
|
||||
__( 'These API keys allow you to use the %1$sEDD REST API%3$s to retrieve store data in JSON or XML for external applications or devices, such as the %2$sEDD mobile app%3$s.', 'easy-digital-downloads' )
|
||||
),
|
||||
'<a href="' . esc_url( $docs_link ) . '">',
|
||||
'<a href="' . esc_url( $ios_link ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</p>
|
||||
<?php
|
||||
|
||||
do_action( 'edd_tools_api_keys_after' );
|
||||
@ -315,7 +339,12 @@ function edd_tools_betas_display() {
|
||||
<input type="checkbox" name="enabled_betas[<?php echo esc_attr( $slug ); ?>]"
|
||||
id="enabled_betas[<?php echo esc_attr( $slug ); ?>]"<?php echo checked( $checked, true, false ); ?>
|
||||
value="1"/>
|
||||
<label for="enabled_betas[<?php echo esc_attr( $slug ); ?>]"><?php printf( __( 'Get updates for pre-release versions of %s', 'easy-digital-downloads' ), esc_html( $product ) ); ?></label>
|
||||
<label for="enabled_betas[<?php echo esc_attr( $slug ); ?>]">
|
||||
<?php
|
||||
/* translators: %s: Product name */
|
||||
printf( esc_html__( 'Get updates for pre-release versions of %s', 'easy-digital-downloads' ), esc_html( $product ) );
|
||||
?>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
@ -483,7 +512,7 @@ function edd_tools_import_export_display() {
|
||||
<input name="edd-import-file" id="edd-payments-import-file" type="file" accept=".csv" required/>
|
||||
</p>
|
||||
<span>
|
||||
<input type="submit" value="<?php _e( 'Import CSV', 'easy-digital-downloads' ); ?>"
|
||||
<input type="submit" value="<?php esc_html_e( 'Import CSV', 'easy-digital-downloads' ); ?>"
|
||||
class="button-secondary"/>
|
||||
<span class="spinner"></span>
|
||||
</span>
|
||||
@ -494,8 +523,12 @@ function edd_tools_import_export_display() {
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
__( 'Each column loaded from the CSV needs to be mapped to an order field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See <a href="%s" target="_blank">this guide</a> for assistance with importing payment records.', 'easy-digital-downloads' ),
|
||||
'https://easydigitaldownloads.com/docs/importing-exporting-orders/'
|
||||
wp_kses_post(
|
||||
/* translators: %1$s opening anchor tag, %2$s closing anchor tag */
|
||||
__( 'Each column loaded from the CSV needs to be mapped to an order field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See %1$sthis guide%2$s for assistance with importing payment records.', 'easy-digital-downloads' )
|
||||
),
|
||||
'<a href="https://easydigitaldownloads.com/docs/importing-exporting-orders/" target="_blank">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
@ -809,8 +842,12 @@ function edd_tools_import_export_display() {
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
__( 'Each column loaded from the CSV needs to be mapped to a Download product field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See <a href="%s" target="_blank">this guide</a> for assistance with importing Download products.', 'easy-digital-downloads' ),
|
||||
'https://easydigitaldownloads.com/docs/importing-exporting-products/'
|
||||
wp_kses_post(
|
||||
/* translators: %1$s and %2$s opening and closing anchor tags respectively */
|
||||
__( 'Each column loaded from the CSV needs to be mapped to a Download product field. Select the column that should be mapped to each field below. Any columns not needed can be ignored. See %1$sthis guide%2$s for assistance with importing Download products.', 'easy-digital-downloads' ),
|
||||
'<a href="https://easydigitaldownloads.com/docs/importing-exporting-products/" target="_blank">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
@ -1005,13 +1042,18 @@ function edd_tools_import_export_display() {
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
__( 'To export shop data (purchases, customers, etc), visit the <a href="%s">Reports</a> page.', 'easy-digital-downloads' ),
|
||||
esc_url( edd_get_admin_url(
|
||||
array(
|
||||
'page' => 'edd-reports',
|
||||
'view' => 'export',
|
||||
wp_kses_post(
|
||||
/* translators: %s: Reports page URL */
|
||||
__( 'To export shop data (purchases, customers, etc), visit the <a href="%s">Reports</a> page.', 'easy-digital-downloads' )
|
||||
),
|
||||
esc_url(
|
||||
edd_get_admin_url(
|
||||
array(
|
||||
'page' => 'edd-reports',
|
||||
'view' => 'export',
|
||||
)
|
||||
)
|
||||
) )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
@ -1188,23 +1230,36 @@ function edd_tools_debug_log_display() {
|
||||
: esc_html__( 'No File', 'easy-digital-downloads' );
|
||||
$log_output = ! empty( $log )
|
||||
? wp_normalize_path( $log )
|
||||
: esc_html__( 'Log is Empty', 'easy-digital-downloads' ); ?>
|
||||
: esc_html__( 'Log is Empty', 'easy-digital-downloads' );
|
||||
?>
|
||||
|
||||
<div class="postbox">
|
||||
<h3><span><?php esc_html_e( 'Debug Log', 'easy-digital-downloads' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<form id="edd-debug-log" method="post">
|
||||
<p><?php _e( 'When debug mode is enabled, specific information will be logged here. (<a href="https://github.com/easydigitaldownloads/easy-digital-downloads/blob/master/includes/class-edd-logging.php">Learn how</a> to use <code>EDD_Logging</code> in your own code.)', 'easy-digital-downloads' ); ?></p>
|
||||
<textarea
|
||||
<div class="postbox">
|
||||
<h3><span><?php esc_html_e( 'Debug Log', 'easy-digital-downloads' ); ?></span></h3>
|
||||
<div class="inside">
|
||||
<form id="edd-debug-log" method="post">
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
wp_kses_post(
|
||||
/* translators: 1. opening anchor tag, do not translate; 2. function name, do not translate; 3. closing anchor tag, do not translate */
|
||||
__( 'When debug mode is enabled, specific information will be logged here. (%1$sLearn how to use %2$s in your own code.%3$s)', 'easy-digital-downloads' )
|
||||
),
|
||||
'<a href="https://easydigitaldownloads.com/docs/edd-debug-log">',
|
||||
'<code>edd_debug_log</code>',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
<textarea
|
||||
readonly="readonly"
|
||||
class="edd-tools-textarea"
|
||||
rows="15"
|
||||
name="edd-debug-log-contents"><?php echo esc_textarea( $log_output ); ?></textarea>
|
||||
<p>
|
||||
<input type="hidden" name="edd_action" value="submit_debug_log"/>
|
||||
<p>
|
||||
<input type="hidden" name="edd_action" value="submit_debug_log"/>
|
||||
<?php
|
||||
submit_button( __( 'Download Debug Log File', 'easy-digital-downloads' ), 'primary', 'edd-download-debug-log', false );
|
||||
submit_button( __( 'Copy to Clipboard', 'easy-digital-downloads' ), 'secondary edd-inline-button', 'edd-copy-debug-log', false, array( 'onclick' => "this.form['edd-debug-log-contents'].focus();this.form['edd-debug-log-contents'].select();document.execCommand('copy');return false;" ) );
|
||||
submit_button( __( 'Download Debug Log File', 'easy-digital-downloads' ), 'primary', 'edd-download-debug-log', false );
|
||||
submit_button( __( 'Copy to Clipboard', 'easy-digital-downloads' ), 'secondary edd-inline-button', 'edd-copy-debug-log', false, array( 'onclick' => "this.form['edd-debug-log-contents'].focus();this.form['edd-debug-log-contents'].select();document.execCommand('copy');return false;" ) );
|
||||
|
||||
// Only show the "Clear Log" button if there is a log to clear
|
||||
if ( ! empty( $log ) ) {
|
||||
@ -1212,16 +1267,16 @@ function edd_tools_debug_log_display() {
|
||||
}
|
||||
|
||||
?>
|
||||
</p>
|
||||
</p>
|
||||
<?php wp_nonce_field( 'edd-debug-log-action' ); ?>
|
||||
</form>
|
||||
</form>
|
||||
|
||||
<p>
|
||||
<?php _e( 'Log file', 'easy-digital-downloads' ); ?>:
|
||||
<code><?php echo esc_html( $path_output ); ?></code>
|
||||
<p>
|
||||
<?php esc_html_e( 'Log file', 'easy-digital-downloads' ); ?>:
|
||||
<code><?php echo esc_html( $path_output ); ?></code>
|
||||
</p>
|
||||
</div><!-- .inside -->
|
||||
</div><!-- .postbox -->
|
||||
</div><!-- .inside -->
|
||||
</div><!-- .postbox -->
|
||||
|
||||
<?php
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Upgrade Functions
|
||||
* Note: Do not move, rename, or delete this file as many extensions will attempt
|
||||
* to require it during an installation or upgrade process.
|
||||
*
|
||||
* @package EDD
|
||||
* @subpackage Admin/Upgrades
|
||||
@ -12,28 +14,7 @@
|
||||
// Exit if accessed directly
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Perform automatic database upgrades when necessary
|
||||
*
|
||||
* @since 2.6
|
||||
* @return void
|
||||
*/
|
||||
function edd_do_automatic_upgrades() {
|
||||
|
||||
$edd_version = edd_get_db_version();
|
||||
if ( version_compare( $edd_version, EDD_VERSION, '>=' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Existing stores should set the upgraded version and the onboarding wizard as complete.
|
||||
if ( ! empty( $edd_version ) ) {
|
||||
update_option( 'edd_version_upgraded_from', $edd_version, false );
|
||||
if ( ! get_option( 'edd_onboarding_completed', false ) && ! get_option( 'edd_onboarding_started', false ) ) {
|
||||
update_option( 'edd_onboarding_completed', true, false );
|
||||
}
|
||||
}
|
||||
edd_update_db_version();
|
||||
}
|
||||
// edd_do_automatic upgrades is defined in includes/upgrades/functions.php
|
||||
add_action( 'admin_init', 'edd_do_automatic_upgrades' );
|
||||
|
||||
/**
|
||||
@ -214,7 +195,7 @@ function edd_show_upgrade_notices() {
|
||||
* NOTICE:
|
||||
*
|
||||
* When adding new upgrade notices, please be sure to put the action
|
||||
* into the upgrades array during install: /includes/install.php @ Appox Line 156
|
||||
* into the upgrades array in `edd_get_all_upgrades`.
|
||||
*/
|
||||
|
||||
// End 'Stepped' upgrade process notices
|
||||
@ -269,80 +250,8 @@ function edd_maybe_resume_upgrade() {
|
||||
return $doing_upgrade;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an upgrade action to the completed upgrades array
|
||||
*
|
||||
* @since 2.3
|
||||
* @param string $upgrade_action The action to add to the copmleted upgrades array
|
||||
* @return bool If the function was successfully added
|
||||
*/
|
||||
function edd_set_upgrade_complete( $upgrade_action = '' ) {
|
||||
|
||||
if ( empty( $upgrade_action ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$completed_upgrades = edd_get_completed_upgrades();
|
||||
$completed_upgrades[] = $upgrade_action;
|
||||
|
||||
// Remove any blanks, and only show uniques
|
||||
$completed_upgrades = array_unique( array_values( $completed_upgrades ) );
|
||||
|
||||
return update_option( 'edd_completed_upgrades', $completed_upgrades );
|
||||
}
|
||||
|
||||
/** 3.0 Upgrades *************************************************************/
|
||||
|
||||
/**
|
||||
* Returns an array of upgrades for 3.0
|
||||
*
|
||||
* Key is the name of the upgrade, which can be used in `edd_has_upgrade_completed()` completed functions.
|
||||
* The value is the name of the associated batch processor class for that upgrade.
|
||||
*
|
||||
* @since 3.0
|
||||
* @return array
|
||||
*/
|
||||
function edd_get_v30_upgrades() {
|
||||
return array(
|
||||
'migrate_tax_rates' => array(
|
||||
'name' => __( 'Tax Rates', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Tax_Rates'
|
||||
),
|
||||
'migrate_discounts' => array(
|
||||
'name' => __( 'Discounts', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Discounts'
|
||||
),
|
||||
'migrate_orders' => array(
|
||||
'name' => __( 'Orders', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Orders'
|
||||
),
|
||||
'migrate_customer_addresses' => array(
|
||||
'name' => __( 'Customer Addresses', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Addresses'
|
||||
),
|
||||
'migrate_customer_email_addresses' => array(
|
||||
'name' => __( 'Customer Email Addresses', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Email_Addresses'
|
||||
),
|
||||
'migrate_customer_notes' => array(
|
||||
'name' => __( 'Customer Notes', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Customer_Notes'
|
||||
),
|
||||
'migrate_logs' => array(
|
||||
'name' => __( 'Logs', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Logs'
|
||||
),
|
||||
'migrate_order_notes' => array(
|
||||
'name' => __( 'Order Notes', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Order_Notes'
|
||||
),
|
||||
'v30_legacy_data_removed' => array(
|
||||
'name' => __( 'Remove Legacy Data', 'easy-digital-downloads' ),
|
||||
'class' => 'EDD\\Admin\\Upgrades\\v3\\Remove_Legacy_Data'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render 3.0 upgrade page.
|
||||
*
|
||||
|
Reference in New Issue
Block a user