Merged in feature/117-dev-dev01 (pull request #8)

auto-patch  117-dev-dev01-2023-12-15T16_09_06

* auto-patch  117-dev-dev01-2023-12-15T16_09_06
This commit is contained in:
Tony Volpe
2023-12-15 16:10:57 +00:00
parent 0825f6bd5f
commit 3dc9eca989
1424 changed files with 28118 additions and 10097 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']