From 6a569ec3a1d129e60546dd572fe03bfb85750575 Mon Sep 17 00:00:00 2001 From: Dan Bitzer Date: Wed, 11 Aug 2021 12:23:21 +0930 Subject: [PATCH] Add comment about global variable usage --- includes/admin/meta-boxes/class-wc-meta-box-order-actions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php b/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php index 7e3f13ad919..29d209688b0 100644 --- a/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php +++ b/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php @@ -26,6 +26,7 @@ class WC_Meta_Box_Order_Actions { global $theorder; // This is used by some callbacks attached to hooks such as woocommerce_order_actions which rely on the global to determine if actions should be displayed for certain orders. + // Avoid using this global with the `woocommerce_order_actions` filter, instead use the $order filter arg. if ( ! is_object( $theorder ) ) { $theorder = wc_get_order( $post->ID ); }