Skip to content

Commit

Permalink
Coding Standards: Rewrite an empty conditional in get_post_status().
Browse files Browse the repository at this point in the history
Expand the comment to further clarify the post object check performed.

Follow-up to [58174].

See #59283.

git-svn-id: https://develop.svn.wordpress.org/trunk@58175 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed May 20, 2024
1 parent ce84e1f commit e6aae43
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -1219,9 +1219,8 @@ function get_post_mime_type( $post = null ) {
* @return string|false Post status on success, false on failure.
*/
function get_post_status( $post = null ) {
if ( $post instanceof WP_Post && isset( $post->filter ) && 'sample' === $post->filter ) {
// Skip normalization
} else {
// Normalize the post object if necessary, skip normalization if called from get_sample_permalink().
if ( ! $post instanceof WP_Post || ! isset( $post->filter ) || 'sample' !== $post->filter ) {
$post = get_post( $post );
}

Expand Down

0 comments on commit e6aae43

Please sign in to comment.