From f8cd908be2b808666863118fcb2d2242f74bcc11 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 12 Jun 2023 06:12:24 +0000 Subject: [PATCH] Coding Standards: Use strict comparison in `wp-includes/class-walker-page.php`. Follow-up to [3704], [9299], [9485], [16100], [44416]. Props aristath, poena, afercia, SergeyBiryukov. See #57839. Built from https://develop.svn.wordpress.org/trunk@55906 git-svn-id: http://core.svn.wordpress.org/trunk@55418 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-walker-page.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/class-walker-page.php b/wp-includes/class-walker-page.php index bec195ed43..3ee5bbda61 100644 --- a/wp-includes/class-walker-page.php +++ b/wp-includes/class-walker-page.php @@ -133,12 +133,12 @@ class Walker_Page extends Walker { $css_class[] = 'current_page_ancestor'; } - if ( $page->ID == $current_page_id ) { + if ( $page->ID === (int) $current_page_id ) { $css_class[] = 'current_page_item'; } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) { $css_class[] = 'current_page_parent'; } - } elseif ( get_option( 'page_for_posts' ) == $page->ID ) { + } elseif ( (int) get_option( 'page_for_posts' ) === $page->ID ) { $css_class[] = 'current_page_parent'; } @@ -168,7 +168,7 @@ class Walker_Page extends Walker { $atts = array(); $atts['href'] = get_permalink( $page->ID ); - $atts['aria-current'] = ( $page->ID == $current_page_id ) ? 'page' : ''; + $atts['aria-current'] = ( $page->ID === (int) $current_page_id ) ? 'page' : ''; /** * Filters the HTML attributes applied to a page menu item's anchor element. diff --git a/wp-includes/version.php b/wp-includes/version.php index a52b497a14..134d4df8f8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55905'; +$wp_version = '6.3-alpha-55906'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.