Make WordPress Core


Ignore:
Timestamp:
10/03/2006 03:40:26 PM (18 years ago)
Author:
ryan
Message:

Pageinate upload tabs. From the Paginator, mdawaffe. fixes #3193

File:
1 edited

Legend:

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

    r4275 r4276  
    903903    // Who knows what else people pass in $args
    904904    $total    = (int) $total;
     905    if ( $total < 2 )
     906        return;
    905907    $current  = (int) $current;
    906908    $end_size = 0  < (int) $end_size ? (int) $end_size : 1; // Out of bounds?  Make it the default.
     
    913915
    914916    if ( $prev_next && $current && 1 < $current ) :
    915         $link = str_replace('%_%', 2 == $current ? '' : str_replace('%#%', $current - 1, $format), $base);
     917        $link = str_replace('%_%', 2 == $current ? '' : $format, $base);
     918        $link = str_replace('%#%', $current - 1, $link);
    916919        if ( $add_args )
    917920            $link = add_query_arg( $add_args, $link );
     
    924927        else :
    925928            if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
    926                 $link = str_replace('%_%', 1 == $n ? '' : str_replace('%#%', $n, $format), $base);
     929                $link = str_replace('%_%', 1 == $n ? '' : $format, $base);
     930                $link = str_replace('%#%', $n, $link);
    927931                if ( $add_args )
    928932                    $link = add_query_arg( $add_args, $link );
     
    936940    endfor;
    937941    if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) :
    938         $link = str_replace('%_%', str_replace('%#%', $current + 1, $format), $base);
     942        $link = str_replace('%_%', $format, $base);
     943        $link = str_replace('%#%', $current + 1, $link);
    939944        if ( $add_args )
    940945            $link = add_query_arg( $add_args, $link );
Note: See TracChangeset for help on using the changeset viewer.