Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in WP_Query::is_page() and …
Browse files Browse the repository at this point in the history
…`::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
  • Loading branch information
SergeyBiryukov committed Feb 8, 2025
1 parent e9b075e commit fc8fa6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wp-includes/class-wp-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -4533,9 +4533,10 @@ public function is_page( $page = '' ) {
if ( ! strpos( $pagepath, '/' ) ) {
continue;
}

$pagepath_obj = get_page_by_path( $pagepath );

if ( $pagepath_obj && ( $pagepath_obj->ID == $page_obj->ID ) ) {
if ( $pagepath_obj && ( $pagepath_obj->ID === $page_obj->ID ) ) {
return true;
}
}
Expand Down Expand Up @@ -4643,9 +4644,10 @@ public function is_single( $post = '' ) {
if ( ! strpos( $postpath, '/' ) ) {
continue;
}

$postpath_obj = get_page_by_path( $postpath, OBJECT, $post_obj->post_type );

if ( $postpath_obj && ( $postpath_obj->ID == $post_obj->ID ) ) {
if ( $postpath_obj && ( $postpath_obj->ID === $post_obj->ID ) ) {
return true;
}
}
Expand Down

0 comments on commit fc8fa6a

Please sign in to comment.