Cleaner and more complete fix for [5017]. fixes #3949

git-svn-id: https://develop.svn.wordpress.org/trunk@5018 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-03-10 06:09:52 +00:00
parent af92eb9142
commit b2105a943e
1 changed files with 20 additions and 15 deletions

View File

@ -155,14 +155,11 @@ function wp_link_pages($args = '') {
$j = str_replace('%',"$i",$pagelink);
$output .= ' ';
if ( ($i != $page) || ((!$more) && ($page==1)) ) {
if ( '' == get_option('permalink_structure') ) {
if ( $i == 1 )
$output .= '<a href="' . get_permalink() . $i . '">';
else
$output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
if ( 1 == $i ) {
$output .= '<a href="' . get_permalink() . '">';
} else {
if ( $i == 1 )
$output .= '<a href="' . get_permalink() . '">';
if ( '' == get_option('permalink_structure') )
$output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">';
}
@ -177,17 +174,25 @@ function wp_link_pages($args = '') {
$output .= $before;
$i = $page - 1;
if ( $i && $more ) {
if ( '' == get_option('permalink_structure') )
$output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $previouspagelink . '</a>';
else
$output .= '<a href="' . get_permalink() . $i . '/">'.$previouspagelink.'</a>';
if ( 1 == $i ) {
$output .= '<a href="' . get_permalink() . '">' . $previouspagelink . '</a>';
} else {
if ( '' == get_option('permalink_structure') )
$output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $previouspagelink . '</a>';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">' . $previouspagelink . '</a>';
}
}
$i = $page + 1;
if ( $i <= $numpages && $more ) {
if ( '' == get_option('permalink_structure') )
$output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">'.$nextpagelink.'</a>';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">' . $nextpagelink . '</a>';
if ( 1 == $i ) {
$output .= '<a href="' . get_permalink() . '">' . $nextpagelink . '</a>';
} else {
if ( '' == get_option('permalink_structure') )
$output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">' . $nextpagelink . '</a>';
else
$output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">' . $nextpagelink . '</a>';
}
}
$output .= $after;
}