[LYS] Fix deprecation error with lowercase $user->id (#46747)

👌 Use uppercase $user->ID and some text updates
This commit is contained in:
Panos (Panagiotis Synetos) 2024-04-19 13:17:14 +03:00 committed by GitHub
parent b575fd580e
commit afc471d0ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1,5 @@
Significance: patch
Type: tweak
Comment: I fixed a deprecation error and updated some translations to a new functionality.

View File

@ -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' );
}
}
}