From 7889eb7cc8fac2ef0cfe31191db51b2fa5a64f4c Mon Sep 17 00:00:00 2001 From: Alexandre Faustino Date: Fri, 22 Sep 2023 07:46:53 +0100 Subject: [PATCH] Fix: my account PDF link conflict with Jetpack analytics module (#612) --- includes/class-wcpdf-frontend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wcpdf-frontend.php b/includes/class-wcpdf-frontend.php index 76c276b48..79ce42bb5 100644 --- a/includes/class-wcpdf-frontend.php +++ b/includes/class-wcpdf-frontend.php @@ -19,7 +19,7 @@ public static function instance() { } public function __construct() { - add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'my_account_pdf_link' ), 10, 2 ); + add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'my_account_pdf_link' ), 999, 2 ); // needs to be triggered later because of Jetpack query string: https://github.com/Automattic/jetpack/blob/1a062c5388083c7f15b9a3e82e61fde838e83047/projects/plugins/jetpack/modules/woocommerce-analytics/classes/class-jetpack-woocommerce-analytics-my-account.php#L235 add_filter( 'woocommerce_api_order_response', array( $this, 'woocommerce_api_invoice_number' ), 10, 2 ); add_action( 'wp_enqueue_scripts', array( $this, 'open_my_account_pdf_link_on_new_tab' ), 999 ); add_shortcode( 'wcpdf_download_invoice', array( $this, 'generate_document_shortcode' ) );