mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
Coding Standards: Use strict type check for in_array() and array_search().
This addresses all the remaining `WordPress.PHP.StrictInArray.MissingTrueStrict` issues in core. Includes minor code layout fixes for better readability. Follow-up to [47550]. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47557 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -122,12 +122,14 @@ class Walker_Page extends Walker {
|
||||
|
||||
if ( ! empty( $current_page ) ) {
|
||||
$_current_page = get_post( $current_page );
|
||||
if ( $_current_page && in_array( $page->ID, $_current_page->ancestors ) ) {
|
||||
|
||||
if ( $_current_page && in_array( $page->ID, $_current_page->ancestors, true ) ) {
|
||||
$css_class[] = 'current_page_ancestor';
|
||||
}
|
||||
|
||||
if ( $page->ID == $current_page ) {
|
||||
$css_class[] = 'current_page_item';
|
||||
} elseif ( $_current_page && $page->ID == $_current_page->post_parent ) {
|
||||
} elseif ( $_current_page && $page->ID === $_current_page->post_parent ) {
|
||||
$css_class[] = 'current_page_parent';
|
||||
}
|
||||
} elseif ( get_option( 'page_for_posts' ) == $page->ID ) {
|
||||
|
||||
Reference in New Issue
Block a user