Make WordPress Core

Changeset 5017


Ignore:
Timestamp:
03/10/2007 05:54:12 AM (20 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post-template.php

    r4953 r5017  
    156156                                $output .= ' ';
    157157                                if ( ($i != $page) || ((!$more) && ($page==1)) ) {
    158                                         if ( '' == get_option('permalink_structure') )
    159                                                 $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
    160                                         else
    161                                                 $output .= '<a href="' . trailingslashit(get_permalink()) . $i . '/">';
     158                                        if ( '' == get_option('permalink_structure') ) {
     159                                                if ( $i == 1 )
     160                                                        $output .= '<a href="' . get_permalink() . $i . '">';
     161                                                else
     162                                                        $output .= '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
     163                                        } else {
     164                                                if ( $i == 1 )
     165                                                        $output .= '<a href="' . get_permalink() . '">';
     166                                                else
     167                                                        $output .= '<a href="' . trailingslashit(get_permalink()) . user_trailingslashit($i) . '">';
     168                                        }
    162169                                }
    163170                                $output .= $j;
Note: See TracChangeset for help on using the changeset viewer.