Add comment about global variable usage

This commit is contained in:
Dan Bitzer 2021-08-11 12:23:21 +09:30
parent 3dd4df2ff5
commit 6a569ec3a1
1 changed files with 1 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class WC_Meta_Box_Order_Actions {
global $theorder; 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. // 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 ) ) { if ( ! is_object( $theorder ) ) {
$theorder = wc_get_order( $post->ID ); $theorder = wc_get_order( $post->ID );
} }