WordPress.org

Make WordPress Core

Ticket #21309: 21309-auto-draft.diff

File 21309-auto-draft.diff, 584 bytes (added by ryan, 8 years ago)
  • wp-includes/link-template.php

     
    266266 * @return string
    267267 */
    268268function _get_page_link( $id = false, $leavename = false, $sample = false ) {
    269         global $post, $wp_rewrite;
     269        global $wp_rewrite;
    270270
    271         if ( !$id )
    272                 $id = (int) $post->ID;
    273         else
    274                 $post = &get_post($id);
     271        $post = get_post( $id );
    275272
    276273        $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
    277274