We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c9c36d commit 37e8a55Copy full SHA for 37e8a55
1 file changed
src/wp-includes/collaboration/class-wp-sync-post-meta-storage.php
@@ -347,7 +347,7 @@ private function resolve_canonical_storage_post_id_after_insert( string $room_ha
347
* @return int|null Canonical storage post ID.
348
*/
349
private function find_canonical_storage_post_id( string $room_hash ): ?int {
350
- $post_id = get_posts(
+ $posts = get_posts(
351
array(
352
'post_type' => self::POST_TYPE,
353
'posts_per_page' => 1,
@@ -359,7 +359,11 @@ private function find_canonical_storage_post_id( string $room_hash ): ?int {
359
)
360
);
361
362
- return is_numeric( $post_id ) ? (int) $post_id : null;
+ if ( empty( $posts ) ) {
363
+ return null;
364
+ }
365
+
366
+ return $posts[0];
367
}
368
369
/**
0 commit comments