Respect user trailing slash preference for multipage posts and eliminate redundant /1/. fixes #3949

git-svn-id: https://develop.svn.wordpress.org/trunk@5017 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-03-10 05:54:12 +00:00
parent 9768611dc1
commit af92eb9142
1 changed files with 11 additions and 4 deletions

View File

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