From 0fced13a9473a072dd8f2d8ce2a66425f973512a Mon Sep 17 00:00:00 2001 From: rob1n Date: Wed, 11 Apr 2007 16:52:58 +0000 Subject: [PATCH] Don't use fancy permalinks on draft previews. Props Viper007Bond. fixes #4117 git-svn-id: https://develop.svn.wordpress.org/trunk@5242 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post-template.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 013136b8b8..4ead5961ca 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -131,6 +131,8 @@ function get_the_excerpt($fakeit = true) { function wp_link_pages($args = '') { + global $post; + if ( is_array($args) ) $r = &$args; else @@ -158,7 +160,7 @@ function wp_link_pages($args = '') { if ( 1 == $i ) { $output .= ''; } else { - if ( '' == get_option('permalink_structure') ) + if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status ) $output .= ''; else $output .= ''; @@ -177,7 +179,7 @@ function wp_link_pages($args = '') { if ( 1 == $i ) { $output .= '' . $previouspagelink . ''; } else { - if ( '' == get_option('permalink_structure') ) + if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status ) $output .= '' . $previouspagelink . ''; else $output .= '' . $previouspagelink . ''; @@ -188,7 +190,7 @@ function wp_link_pages($args = '') { if ( 1 == $i ) { $output .= '' . $nextpagelink . ''; } else { - if ( '' == get_option('permalink_structure') ) + if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status ) $output .= '' . $nextpagelink . ''; else $output .= '' . $nextpagelink . '';