Skip to content

Commit fc8fa6a

Browse files
Coding Standards: Use strict comparison in WP_Query::is_page() and ::is_single().
Follow-up to [29039]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59788 602fd350-edb4-49c9-b593-d223f7449a82
1 parent e9b075e commit fc8fa6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wp-includes/class-wp-query.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4533,9 +4533,10 @@ public function is_page( $page = '' ) {
45334533
if ( ! strpos( $pagepath, '/' ) ) {
45344534
continue;
45354535
}
4536+
45364537
$pagepath_obj = get_page_by_path( $pagepath );
45374538

4538-
if ( $pagepath_obj && ( $pagepath_obj->ID == $page_obj->ID ) ) {
4539+
if ( $pagepath_obj && ( $pagepath_obj->ID === $page_obj->ID ) ) {
45394540
return true;
45404541
}
45414542
}
@@ -4643,9 +4644,10 @@ public function is_single( $post = '' ) {
46434644
if ( ! strpos( $postpath, '/' ) ) {
46444645
continue;
46454646
}
4647+
46464648
$postpath_obj = get_page_by_path( $postpath, OBJECT, $post_obj->post_type );
46474649

4648-
if ( $postpath_obj && ( $postpath_obj->ID == $post_obj->ID ) ) {
4650+
if ( $postpath_obj && ( $postpath_obj->ID === $post_obj->ID ) ) {
46494651
return true;
46504652
}
46514653
}

0 commit comments

Comments
 (0)