mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-07 10:40:11 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@55906 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user