Skip to content

Commit 37e8a55

Browse files
committed
Incorporate fix from WordPress/gutenberg#78053
1 parent 9c9c36d commit 37e8a55

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/wp-includes/collaboration/class-wp-sync-post-meta-storage.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ private function resolve_canonical_storage_post_id_after_insert( string $room_ha
347347
* @return int|null Canonical storage post ID.
348348
*/
349349
private function find_canonical_storage_post_id( string $room_hash ): ?int {
350-
$post_id = get_posts(
350+
$posts = get_posts(
351351
array(
352352
'post_type' => self::POST_TYPE,
353353
'posts_per_page' => 1,
@@ -359,7 +359,11 @@ private function find_canonical_storage_post_id( string $room_hash ): ?int {
359359
)
360360
);
361361

362-
return is_numeric( $post_id ) ? (int) $post_id : null;
362+
if ( empty( $posts ) ) {
363+
return null;
364+
}
365+
366+
return $posts[0];
363367
}
364368

365369
/**

0 commit comments

Comments
 (0)