Make WordPress Core


Ignore:
Timestamp:
02/08/2025 03:30:08 PM (18 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison in WP_Query::is_page() and ::is_single().

Follow-up to [29039].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.

File:
1 edited

Legend:

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

    r59771 r59788  
    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                                }
     
    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                                }
Note: See TracChangeset for help on using the changeset viewer.