From 1dd2f28680c98373468adb53aff18df00586c559 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 10 Jan 2025 18:12:08 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `get_posts_by_author_sql()`. Follow-up to [13576], [25669]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59596 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index a0933f1ffdbf8..ebf7c7f3a9e40 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -7358,7 +7358,7 @@ function get_posts_by_author_sql( $post_type, $full = true, $post_author = null, $id = get_current_user_id(); if ( null === $post_author || ! $full ) { $post_status_sql .= " OR post_status = 'private' AND post_author = $id"; - } elseif ( $id == (int) $post_author ) { + } elseif ( $id === (int) $post_author ) { $post_status_sql .= " OR post_status = 'private'"; } // Else none. } // Else none.