Posts, Post Types: Avoid an extra database query in WP_Post for a negative post ID.

Follow-up to [21559].

Props bor0, akeda, SergeyBiryukov.
Fixes #63850.
Built from https://develop.svn.wordpress.org/trunk@60654


git-svn-id: http://core.svn.wordpress.org/trunk@59990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2025-08-20 15:01:31 +00:00
parent b745bbc180
commit 6d1bd80da8
2 changed files with 2 additions and 2 deletions

View File

@@ -233,7 +233,7 @@ final class WP_Post {
global $wpdb;
$post_id = (int) $post_id;
if ( ! $post_id ) {
if ( $post_id <= 0 ) {
return false;
}

View File

@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.9-alpha-60653';
$wp_version = '6.9-alpha-60654';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.