WordPress.org

Make WordPress Core

Changeset 27523


Ignore:
Timestamp:
03/13/14 17:38:51 (3 years ago)
Author:
johnbillion
Message:

Improve paginate_links() performance by not calling number_format_i18n() unnecessarily. Fixes #25735 with tests. Props johnpbloch.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r27380 r27523  
    20312031    endif; 
    20322032    for ( $n = 1; $n <= $total; $n++ ) : 
    2033         $n_display = number_format_i18n($n); 
    20342033        if ( $n == $current ) : 
    2035             $page_links[] = "<span class='page-numbers current'>$n_display</span>"; 
     2034            $page_links[] = "<span class='page-numbers current'>" . number_format_i18n($n) . "</span>"; 
    20362035            $dots = true; 
    20372036        else : 
     
    20422041                    $link = add_query_arg( $add_args, $link ); 
    20432042                $link .= $add_fragment; 
    2044                 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>"; 
     2043                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . number_format_i18n($n) . "</a>"; 
    20452044                $dots = true; 
    20462045            elseif ( $dots && !$show_all ) : 
Note: See TracChangeset for help on using the changeset viewer.