WordPress.org

Make WordPress Core

Changeset 17061


Ignore:
Timestamp:
12/19/10 14:42:17 (4 years ago)
Author:
ryan
Message:

Fix guid generation for page auto drafts. Props shawnparker. fixes #15041

File:
1 edited

Legend:

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

    r16994 r17061  
    272272        $post = &get_post($id); 
    273273 
     274    $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) ); 
     275 
    274276    $link = $wp_rewrite->get_page_permastruct(); 
    275  
    276     if ( '' != $link && ( ( isset($post->post_status) && 'draft' != $post->post_status && 'pending' != $post->post_status ) || $sample ) ) { 
    277         if ( ! $leavename ) 
     277         
     278    if ( !empty($link) && ( ( isset($post->post_status) && !$draft_or_pending ) || $sample ) ) {     
     279        if ( ! $leavename ) { 
    278280            $link = str_replace('%pagename%', get_page_uri($id), $link); 
     281        } 
     282 
    279283        $link = home_url($link); 
    280284        $link = user_trailingslashit($link, 'page'); 
Note: See TracChangeset for help on using the changeset viewer.