Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in sanitize_post().
Browse files Browse the repository at this point in the history
Follow-up to [12062].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@59565 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Dec 29, 2024
1 parent 4a6b12b commit 4e1752d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -2823,7 +2823,7 @@ function is_sticky( $post_id = 0 ) {
function sanitize_post( $post, $context = 'display' ) {
if ( is_object( $post ) ) {
// Check if post already filtered for this context.
if ( isset( $post->filter ) && $context == $post->filter ) {
if ( isset( $post->filter ) && $context === $post->filter ) {
return $post;
}
if ( ! isset( $post->ID ) ) {
Expand All @@ -2835,7 +2835,7 @@ function sanitize_post( $post, $context = 'display' ) {
$post->filter = $context;
} elseif ( is_array( $post ) ) {
// Check if post already filtered for this context.
if ( isset( $post['filter'] ) && $context == $post['filter'] ) {
if ( isset( $post['filter'] ) && $context === $post['filter'] ) {
return $post;
}
if ( ! isset( $post['ID'] ) ) {
Expand Down

0 comments on commit 4e1752d

Please sign in to comment.