wp/wp-includes/class-walker-page.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
--- a/wp/wp-includes/class-walker-page.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/class-walker-page.php	Fri Sep 05 18:40:08 2025 +0200
@@ -104,7 +104,8 @@
 	 */
 	public function start_el( &$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0 ) {
 		// Restores the more descriptive, specific name for use within this method.
-		$page            = $data_object;
+		$page = $data_object;
+
 		$current_page_id = $current_object_id;
 
 		if ( isset( $args['item_spacing'] ) && 'preserve' === $args['item_spacing'] ) {
@@ -133,12 +134,12 @@
 				$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 +169,7 @@
 
 		$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.
@@ -241,5 +242,4 @@
 		}
 		$output .= "</li>{$n}";
 	}
-
 }