From d76c427a42121f8dff4c9f61b8ee85056e20e179 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 8 Feb 2025 15:32:24 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `WP_Query::is_page()` and `::is_single()`. Follow-up to [29039]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. Built from https://develop.svn.wordpress.org/trunk@59788 git-svn-id: http://core.svn.wordpress.org/trunk@59130 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-query.php | 6 ++++-- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 51cd8b1084..06b1e582a7 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -4533,9 +4533,10 @@ class WP_Query { if ( ! strpos( $pagepath, '/' ) ) { continue; } + $pagepath_obj = get_page_by_path( $pagepath ); - if ( $pagepath_obj && ( $pagepath_obj->ID == $page_obj->ID ) ) { + if ( $pagepath_obj && ( $pagepath_obj->ID === $page_obj->ID ) ) { return true; } } @@ -4643,9 +4644,10 @@ class WP_Query { if ( ! strpos( $postpath, '/' ) ) { continue; } + $postpath_obj = get_page_by_path( $postpath, OBJECT, $post_obj->post_type ); - if ( $postpath_obj && ( $postpath_obj->ID == $post_obj->ID ) ) { + if ( $postpath_obj && ( $postpath_obj->ID === $post_obj->ID ) ) { return true; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index cd1ed08137..ef146df495 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59787'; +$wp_version = '6.8-alpha-59788'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.