WordPress.org

Make WordPress Core

Ticket #23458: better-status-handling-for-custom-posts.diff

File better-status-handling-for-custom-posts.diff, 932 bytes (added by misterbisson, 5 years ago)
  • wp-includes/link-template.php

     
    187187
    188188        $slug = $post->post_name;
    189189
    190         $draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
     190        $draft_or_pending = get_post_status( $id ) && in_array( get_post_status( $id ), array( 'draft', 'pending', 'auto-draft' ) );
    191191
    192192        $post_type = get_post_type_object($post->post_type);
    193193
  • wp-includes/post.php

     
    848848                        return get_post_status($post->post_parent);
    849849        }
    850850
    851         return $post->post_status;
     851        return apply_filters( 'get_post_status', $post->post_status, $post );
    852852}
    853853
    854854/**