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
This commit is contained in:
parent
95918aee5d
commit
0fced13a94
|
@ -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