Make WordPress Core


Ignore:
Timestamp:
06/12/2023 06:10:17 AM (17 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-walker-page.php

    r52652 r55906  
    134134            }
    135135
    136             if ( $page->ID == $current_page_id ) {
     136            if ( $page->ID === (int) $current_page_id ) {
    137137                $css_class[] = 'current_page_item';
    138138            } elseif ( $_current_page && $page->ID === $_current_page->post_parent ) {
    139139                $css_class[] = 'current_page_parent';
    140140            }
    141         } elseif ( get_option( 'page_for_posts' ) == $page->ID ) {
     141        } elseif ( (int) get_option( 'page_for_posts' ) === $page->ID ) {
    142142            $css_class[] = 'current_page_parent';
    143143        }
     
    169169        $atts                 = array();
    170170        $atts['href']         = get_permalink( $page->ID );
    171         $atts['aria-current'] = ( $page->ID == $current_page_id ) ? 'page' : '';
     171        $atts['aria-current'] = ( $page->ID === (int) $current_page_id ) ? 'page' : '';
    172172
    173173        /**
Note: See TracChangeset for help on using the changeset viewer.