Don't use fancy permalinks on draft previews. Props Viper007Bond. fixes #4117
git-svn-id: http://svn.automattic.com/wordpress/trunk@5242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
61e18c550e
commit
f0da57ee4e
|
@ -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 .= '<a href="' . get_permalink() . '">';
|
||||
} else {
|
||||
if ( '' == get_option('permalink_structure') )
|
||||
if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status )
|
||||
$output .= '<a href="' . get_permalink() . '&page=' . $i . '">';
|
||||
else
|
||||
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">';
|
||||
|
@ -177,7 +179,7 @@ function wp_link_pages($args = '') {
|
|||
if ( 1 == $i ) {
|
||||
$output .= '<a href="' . get_permalink() . '">' . $previouspagelink . '</a>';
|
||||
} else {
|
||||
if ( '' == get_option('permalink_structure') )
|
||||
if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status )
|
||||
$output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $previouspagelink . '</a>';
|
||||
else
|
||||
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $previouspagelink . '</a>';
|
||||
|
@ -188,7 +190,7 @@ function wp_link_pages($args = '') {
|
|||
if ( 1 == $i ) {
|
||||
$output .= '<a href="' . get_permalink() . '">' . $nextpagelink . '</a>';
|
||||
} else {
|
||||
if ( '' == get_option('permalink_structure') )
|
||||
if ( '' == get_option('permalink_structure') || 'draft' == $post->post_status )
|
||||
$output .= '<a href="' . get_permalink() . '&page=' . $i . '">' . $nextpagelink . '</a>';
|
||||
else
|
||||
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged') . '">' . $nextpagelink . '</a>';
|
||||
|
|
Loading…
Reference in New Issue