diff --git a/plugins/woocommerce/changelog/50720-fix-missing-logout-confirmation b/plugins/woocommerce/changelog/50720-fix-missing-logout-confirmation new file mode 100644 index 00000000000..6dc236fbc97 --- /dev/null +++ b/plugins/woocommerce/changelog/50720-fix-missing-logout-confirmation @@ -0,0 +1,4 @@ +Significance: patch +Type: tweak +Comment: Fixes missing global in unreleased code. + diff --git a/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php b/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php index 041b6853514..c090b4a52a1 100644 --- a/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php +++ b/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php @@ -64,6 +64,8 @@ class WC_Shortcode_My_Account { * logged out. See `woocommerce_my_account_message`. */ private static function my_account_add_notices() { + global $wp; + if ( ! is_user_logged_in() ) { /** * Filters the message shown on the 'my account' page when the user is not logged in.