From 66a717840feef68bb9cc2f2346a3b20b3344bea0 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 16 Aug 2024 12:18:23 +0100 Subject: [PATCH] Logout confirmation notice missing due to global (#50720) * Missing global $wp * Add changefile(s) from automation for the following project(s): woocommerce --------- Co-authored-by: github-actions --- .../changelog/50720-fix-missing-logout-confirmation | 4 ++++ .../includes/shortcodes/class-wc-shortcode-my-account.php | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 plugins/woocommerce/changelog/50720-fix-missing-logout-confirmation 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.