From afc471d0ed3d3fe2964930d7c2f83eac30158aba Mon Sep 17 00:00:00 2001 From: "Panos (Panagiotis Synetos)" <2484390+PanosSynetos@users.noreply.github.com> Date: Fri, 19 Apr 2024 13:17:14 +0300 Subject: [PATCH] [LYS] Fix deprecation error with lowercase $user->id (#46747) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 👌 Use uppercase $user->ID and some text updates --- plugins/woocommerce/changelog/update-use-uppercase-user-id | 5 +++++ plugins/woocommerce/src/Admin/Features/LaunchYourStore.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 plugins/woocommerce/changelog/update-use-uppercase-user-id diff --git a/plugins/woocommerce/changelog/update-use-uppercase-user-id b/plugins/woocommerce/changelog/update-use-uppercase-user-id new file mode 100644 index 00000000000..1673f6462ed --- /dev/null +++ b/plugins/woocommerce/changelog/update-use-uppercase-user-id @@ -0,0 +1,5 @@ +Significance: patch +Type: tweak +Comment: I fixed a deprecation error and updated some translations to a new functionality. + + diff --git a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php index d166439b2c3..80865f089d5 100644 --- a/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php +++ b/plugins/woocommerce/src/Admin/Features/LaunchYourStore.php @@ -177,7 +177,7 @@ class LaunchYourStore { self::BANNER_DISMISS_USER_META_KEY, array( 'type' => 'string', - 'description' => 'Indicate wheter user has dismissed coming soon notice or not', + 'description' => 'Indicate whether the user has dismissed the coming soon notice or not.', 'single' => true, 'show_in_rest' => true, ) @@ -193,9 +193,9 @@ class LaunchYourStore { * @param object $user user object. */ public function reset_woocommerce_coming_soon_banner_dismissed( $user_login, $user ) { - $existing_meta = get_user_meta( $user->id, self::BANNER_DISMISS_USER_META_KEY, true ); + $existing_meta = get_user_meta( $user->ID, self::BANNER_DISMISS_USER_META_KEY, true ); if ( 'yes' === $existing_meta ) { - update_user_meta( $user->id, self::BANNER_DISMISS_USER_META_KEY, 'no' ); + update_user_meta( $user->ID, self::BANNER_DISMISS_USER_META_KEY, 'no' ); } } }