Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in `wp_check_for_changed_date…
Browse files Browse the repository at this point in the history
…s()`.

Follow-up to [42401].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@59593 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jan 8, 2025
1 parent 287b2f8 commit 86f31c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -7255,12 +7255,14 @@ function wp_check_for_changed_dates( $post_id, $post, $post_before ) {
$new_date = gmdate( 'Y-m-d', strtotime( $post->post_date ) );

// Don't bother if it hasn't changed.
if ( $new_date == $previous_date ) {
if ( $new_date === $previous_date ) {
return;
}

// We're only concerned with published, non-hierarchical objects.
if ( ! ( 'publish' === $post->post_status || ( 'attachment' === get_post_type( $post ) && 'inherit' === $post->post_status ) ) || is_post_type_hierarchical( $post->post_type ) ) {
if ( ! ( 'publish' === $post->post_status || ( 'attachment' === $post->post_type && 'inherit' === $post->post_status ) )
|| is_post_type_hierarchical( $post->post_type )
) {
return;
}

Expand Down

0 comments on commit 86f31c8

Please sign in to comment.