Make WordPress Core

Changeset 58175


Ignore:
Timestamp:
05/20/2024 01:42:12 PM (4 weeks ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Rewrite an empty conditional in get_post_status().

Expand the comment to further clarify the post object check performed.

Follow-up to [58174].

See #59283.

File:
1 edited

Legend:

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

    r58174 r58175  
    12201220 */
    12211221function get_post_status( $post = null ) {
    1222     if ( $post instanceof WP_Post && isset( $post->filter ) && 'sample' === $post->filter ) {
    1223         // Skip normalization
    1224     } else {
     1222    // Normalize the post object if necessary, skip normalization if called from get_sample_permalink().
     1223    if ( ! $post instanceof WP_Post || ! isset( $post->filter ) || 'sample' !== $post->filter ) {
    12251224        $post = get_post( $post );
    12261225    }
Note: See TracChangeset for help on using the changeset viewer.