From 37bbac346e3cfddc130c564cbcb0c15ee8f20e75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismael=20Mart=C3=ADn=20Alabarce?= Date: Thu, 14 Sep 2023 14:25:18 +0200 Subject: [PATCH] Increase admin enqueue scripts priority (#7197) --- changelog/fix-7067-admin-enqueue-scripts-priority | 4 ++++ includes/admin/class-wc-payments-admin.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 changelog/fix-7067-admin-enqueue-scripts-priority diff --git a/changelog/fix-7067-admin-enqueue-scripts-priority b/changelog/fix-7067-admin-enqueue-scripts-priority new file mode 100644 index 00000000000..d23c2da6dd7 --- /dev/null +++ b/changelog/fix-7067-admin-enqueue-scripts-priority @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Increase admin enqueue scripts priority to avoid compatibility issues with WooCommerce Beta Tester plugin. diff --git a/includes/admin/class-wc-payments-admin.php b/includes/admin/class-wc-payments-admin.php index c6695067a9e..3080cd9a4f8 100644 --- a/includes/admin/class-wc-payments-admin.php +++ b/includes/admin/class-wc-payments-admin.php @@ -145,8 +145,8 @@ public function __construct( add_action( 'admin_menu', [ $this, 'add_payments_menu' ], 0 ); add_action( 'admin_init', [ $this, 'maybe_redirect_to_onboarding' ], 11 ); // Run this after the WC setup wizard and onboarding redirection logic. add_action( 'admin_enqueue_scripts', [ $this, 'maybe_redirect_overview_to_connect' ], 1 ); // Run this late (after `admin_init`) but before any scripts are actually enqueued. - add_action( 'admin_enqueue_scripts', [ $this, 'register_payments_scripts' ] ); - add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_payments_scripts' ], 12 ); + add_action( 'admin_enqueue_scripts', [ $this, 'register_payments_scripts' ], 9 ); + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_payments_scripts' ], 9 ); add_action( 'woocommerce_admin_field_payment_gateways', [ $this, 'payment_gateways_container' ] ); add_action( 'woocommerce_admin_order_totals_after_total', [ $this, 'show_woopay_payment_method_name_admin' ] ); add_action( 'woocommerce_admin_order_totals_after_total', [ $this, 'display_wcpay_transaction_fee' ] );