Make WordPress Core


Ignore:
Timestamp:
12/20/2010 11:41:08 AM (14 years ago)
Author:
ryan
Message:

Relocate isset check. Props TobiasBg, SergeyBiryukov. fixes #15041

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/link-template.php

    r17061 r17076  
    186186    $slug = $post->post_name;
    187187
    188     $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
     188    $draft_or_pending = isset($post->post_status) && in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
    189189
    190190    $post_type = get_post_type_object($post->post_type);
    191191
    192     if ( !empty($post_link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {
     192    if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
    193193        if ( ! $leavename ) {
    194194            if ( $post_type->hierarchical )
Note: See TracChangeset for help on using the changeset viewer.