updated plugin Easy Digital Downloads
version 3.1.1.2
This commit is contained in:
@ -150,17 +150,18 @@ add_action( 'wp_enqueue_scripts', 'edd_enqueue_styles' );
|
||||
function edd_localize_scripts() {
|
||||
global $post;
|
||||
|
||||
$version = edd_admin_get_script_version();
|
||||
$version = edd_admin_get_script_version();
|
||||
$currency = new \EDD\Currency\Currency( edd_get_currency() );
|
||||
|
||||
if ( edd_is_checkout() ) {
|
||||
wp_localize_script( 'edd-checkout-global', 'edd_global_vars', apply_filters( 'edd_global_checkout_script_vars', array(
|
||||
'ajaxurl' => esc_url_raw( edd_get_ajax_url() ),
|
||||
'checkout_nonce' => wp_create_nonce( 'edd_checkout_nonce' ),
|
||||
'checkout_error_anchor' => '#edd_purchase_submit',
|
||||
'currency_sign' => edd_currency_filter(''),
|
||||
'currency_pos' => edd_get_option( 'currency_position', 'before' ),
|
||||
'decimal_separator' => edd_get_option( 'decimal_separator', '.' ),
|
||||
'thousands_separator' => edd_get_option( 'thousands_separator', ',' ),
|
||||
'currency_sign' => $currency->symbol,
|
||||
'currency_pos' => $currency->position,
|
||||
'decimal_separator' => $currency->decimal_separator,
|
||||
'thousands_separator' => $currency->thousands_separator,
|
||||
'no_gateway' => __( 'Please select a payment method', 'easy-digital-downloads' ),
|
||||
'no_discount' => __( 'Please enter a discount code', 'easy-digital-downloads' ), // Blank discount code message
|
||||
'enter_discount' => __( 'Enter discount', 'easy-digital-downloads' ),
|
||||
@ -316,6 +317,7 @@ function edd_register_admin_scripts() {
|
||||
'tools-export' => array(),
|
||||
'tools-import' => array(),
|
||||
'notes' => array(),
|
||||
'onboarding' => array(),
|
||||
'orders' => array(
|
||||
'edd-admin-notes',
|
||||
'wp-util',
|
||||
@ -330,7 +332,7 @@ function edd_register_admin_scripts() {
|
||||
'tools' => array(
|
||||
'edd-admin-tools-export'
|
||||
),
|
||||
'upgrades' => array()
|
||||
'upgrades' => array(),
|
||||
);
|
||||
|
||||
foreach ( $admin_pages as $page => $deps ) {
|
||||
@ -358,12 +360,13 @@ function edd_register_admin_styles() {
|
||||
// Register styles
|
||||
wp_register_style( 'jquery-chosen', $css_dir . 'chosen' . $css_suffix, array(), $version );
|
||||
wp_register_style( 'jquery-ui-css', $css_dir . 'jquery-ui-fresh' . $css_suffix, array(), $version );
|
||||
wp_register_style( 'edd-admin', $css_dir . 'edd-admin' . $css_suffix, array(), $version );
|
||||
wp_register_style( 'edd-admin', $css_dir . 'edd-admin' . $css_suffix, array( 'forms' ), $version );
|
||||
wp_register_style( 'edd-admin-menu', $css_dir . 'edd-admin-menu' . $css_suffix, array(), $version );
|
||||
wp_register_style( 'edd-admin-chosen', $css_dir . 'edd-admin-chosen' . $css_suffix, $deps, $version );
|
||||
wp_register_style( 'edd-admin-email-tags', $css_dir . 'edd-admin-email-tags' . $css_suffix, $deps, $version );
|
||||
wp_register_style( 'edd-admin-datepicker', $css_dir . 'edd-admin-datepicker' . $css_suffix, $deps, $version );
|
||||
wp_register_style( 'edd-admin-tax-rates', $css_dir . 'edd-admin-tax-rates' . $css_suffix, $deps, $version );
|
||||
wp_register_style( 'edd-admin-onboarding', $css_dir . 'edd-admin-onboarding' . $css_suffix, $deps, $version );
|
||||
}
|
||||
add_action( 'admin_init', 'edd_register_admin_styles' );
|
||||
|
||||
@ -379,6 +382,13 @@ function edd_enqueue_admin_scripts( $hook = '' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the CM Admin Tools JS from loading on our settings pages, as they
|
||||
* are including options and actions that can permemtnly harm a store's data.
|
||||
*/
|
||||
wp_deregister_script( 'cmadm-utils' );
|
||||
wp_deregister_script( 'cmadm-backend' );
|
||||
|
||||
// Enqueue media on EDD admin pages
|
||||
wp_enqueue_media();
|
||||
|
||||
@ -479,21 +489,22 @@ function edd_localize_admin_scripts() {
|
||||
}
|
||||
}
|
||||
|
||||
$edd_currency = new EDD\Currency\Currency( $currency );
|
||||
|
||||
// Admin scripts
|
||||
wp_localize_script( 'edd-admin-scripts', 'edd_vars', array(
|
||||
'post_id' => get_the_ID(),
|
||||
'edd_version' => edd_admin_get_script_version(),
|
||||
'currency' => $currency,
|
||||
'currency_sign' => edd_currency_filter( '', $currency ),
|
||||
'currency_pos' => edd_get_option( 'currency_position', 'before' ),
|
||||
'currency_decimals' => edd_currency_decimal_filter( 2, $currency ),
|
||||
'decimal_separator' => edd_get_option( 'decimal_separator', '.' ),
|
||||
'thousands_separator' => edd_get_option( 'thousands_separator', ',' ),
|
||||
'currency' => $edd_currency->code,
|
||||
'currency_sign' => $edd_currency->symbol,
|
||||
'currency_pos' => $edd_currency->position,
|
||||
'currency_decimals' => $edd_currency->number_decimals,
|
||||
'decimal_separator' => $edd_currency->decimal_separator,
|
||||
'thousands_separator' => $edd_currency->thousands_separator,
|
||||
'date_picker_format' => edd_get_date_picker_format( 'js' ),
|
||||
'add_new_download' => __( 'Add New Download', 'easy-digital-downloads' ),
|
||||
'use_this_file' => __( 'Use This File', 'easy-digital-downloads' ),
|
||||
'quick_edit_warning' => __( 'Sorry, not available for variable priced products.', 'easy-digital-downloads' ),
|
||||
'delete_payment' => __( 'Are you sure you want to delete this order?', 'easy-digital-downloads' ),
|
||||
'delete_order_item' => __( 'Are you sure you want to delete this item?', 'easy-digital-downloads' ),
|
||||
'delete_order_adjustment' => __( 'Are you sure you want to delete this adjustment?', 'easy-digital-downloads' ),
|
||||
'delete_note' => __( 'Are you sure you want to delete this note?', 'easy-digital-downloads' ),
|
||||
@ -525,14 +536,19 @@ function edd_localize_admin_scripts() {
|
||||
'wait' => __( 'Please wait …', 'easy-digital-downloads' ),
|
||||
'test_email_save_changes' => __( 'You must save your changes to send the test email.', 'easy-digital-downloads' ),
|
||||
|
||||
// Features
|
||||
'quantities_enabled' => edd_item_quantities_enabled(),
|
||||
'taxes_enabled' => edd_use_taxes(),
|
||||
'taxes_included' => edd_use_taxes() && edd_prices_include_tax(),
|
||||
'new_media_ui' => apply_filters( 'edd_use_35_media_ui', 1 ),
|
||||
// Diaglog buttons.
|
||||
'confirm_dialog_text' => __( 'Confirm', 'easy-digital-downloads' ),
|
||||
'cancel_dialog_text' => __( 'Cancel', 'easy-digital-downloads' ),
|
||||
|
||||
'restBase' => rest_url( \EDD\API\v3\Endpoint::$namespace ),
|
||||
'restNonce' => wp_create_nonce( 'wp_rest' ),
|
||||
// Features.
|
||||
'quantities_enabled' => edd_item_quantities_enabled(),
|
||||
'taxes_enabled' => edd_use_taxes(),
|
||||
'taxes_included' => edd_use_taxes() && edd_prices_include_tax(),
|
||||
'new_media_ui' => edd_apply_filters_deprecated( 'edd_use_35_media_ui', array( 1 ), '3.1.1', false, __( 'The edd_use_35_media_ui filter is no longer supported.', 'easy-digital-downloads' ) ),
|
||||
|
||||
// REST based items.
|
||||
'restBase' => rest_url( \EDD\API\v3\Endpoint::$namespace ),
|
||||
'restNonce' => wp_create_nonce( 'wp_rest' ),
|
||||
) );
|
||||
|
||||
wp_localize_script( 'edd-admin-upgrades', 'edd_admin_upgrade_vars', array(
|
||||
|
Reference in New Issue
Block a user