rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -716,7 +716,6 @@ class Yoast_Notification_Center {
* @return void
*/
private function retrieve_notifications_from_storage( $user_id ) {
if ( $this->notifications_retrieved ) {
return;
}
@@ -732,6 +731,7 @@ class Yoast_Notification_Center {
if ( is_array( $stored_notifications ) ) {
$notifications = array_map( [ $this, 'array_to_notification' ], $stored_notifications );
// Apply array_values to ensure we get a 0-indexed array.
$notifications = array_values( array_filter( $notifications, [ $this, 'filter_notification_current_user' ] ) );
@@ -841,6 +841,13 @@ class Yoast_Notification_Center {
$notification_data['message'] = $notification_data['message']->present();
}
if ( isset( $notification_data['options']['user'] ) ) {
$notification_data['options']['user_id'] = $notification_data['options']['user']->ID;
unset( $notification_data['options']['user'] );
$this->notifications_need_storage = true;
}
return new Yoast_Notification(
$notification_data['message'],
$notification_data['options']