WordPress.org

Make WordPress Core

Ticket #33405: 33405.2.diff

File 33405.2.diff, 1.1 KB (added by luukdv, 5 years ago)
  • wp-includes/general-template.php

    diff --git wp-includes/general-template.php wp-includes/general-template.php
    index ed91e5b..ec29a04 100644
    function paginate_links( $args = '' ) { 
    33303330                        $page_links[] = "<span class='page-numbers current'>" . $args['before_page_number'] . number_format_i18n( $n ) . $args['after_page_number'] . "</span>";
    33313331                        $dots = true;
    33323332                else :
    3333                         if ( $args['show_all'] || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
     3333                        $in_range = $n >= $current - $mid_size && $n <= $current + $mid_size;
     3334                        // If the dots cover only one link, just show the link instead
     3335                        $singular = $n >= $current - $mid_size - 1 && $n <= $current + $mid_size + 1 && ( $n == $end_size + 1 || $n == $total - $end_size );
     3336
     3337                        if ( $args['show_all'] || ( $n <= $end_size || ( $current && ( $in_range || $singular ) ) || $n > $total - $end_size ) ) :
    33343338                                $link = str_replace( '%_%', 1 == $n ? '' : $args['format'], $args['base'] );
    33353339                                $link = str_replace( '%#%', $n, $link );
    33363340                                if ( $add_args )