Make WordPress Core

Ticket #24709: 24709.2.patch

File 24709.2.patch, 2.7 KB (added by GrahamArmfield, 11 years ago)

Revised patch to incorporate argument name changes and inline documentation changes asked for by @johnbillion

  • wp-includes/general-template.php

     
    19831983 * It is possible to add query vars to the link by using the 'add_args' argument
    19841984 * and see {@link add_query_arg()} for more information.
    19851985 *
     1986 * The 'before_page_number' and 'after_page_number' arguments allow users to
     1987 * augment the links themselves. Typically this might be to add context to the
     1988 * numbered links so that screen reader users understand what the links are for.
     1989 * The text strings are added before and after the page number - within the
     1990 * anchor tag.
     1991 *
    19861992 * @since 2.1.0
    19871993 *
    19881994 * @param string|array $args Optional. Override defaults.
     
    20022008                'mid_size' => 2,
    20032009                'type' => 'plain',
    20042010                'add_args' => false, // array of query args to add
    2005                 'add_fragment' => ''
     2011                'add_fragment' => '',
     2012                'before_page_number' => '',
     2013                'after_page_number' => ''
    20062014        );
    20072015
    20082016        $args = wp_parse_args( $args, $defaults );
     
    20322040        for ( $n = 1; $n <= $total; $n++ ) :
    20332041                $n_display = number_format_i18n($n);
    20342042                if ( $n == $current ) :
    2035                         $page_links[] = "<span class='page-numbers current'>$n_display</span>";
     2043                        $page_links[] = "<span class='page-numbers current'>" . $before_page_number . $n_display . $after_page_number . "</span>";
    20362044                        $dots = true;
    20372045                else :
    20382046                        if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) :
     
    20412049                                if ( $add_args )
    20422050                                        $link = add_query_arg( $add_args, $link );
    20432051                                $link .= $add_fragment;
    2044                                 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>$n_display</a>";
     2052                                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $before_page_number . $n_display . $after_page_number . "</a>";
    20452053                                $dots = true;
    20462054                        elseif ( $dots && !$show_all ) :
    20472055                                $page_links[] = '<span class="page-numbers dots">' . __( '&hellip;' ) . '</span>';
  • wp-includes/link-template.php

     
    21722172                'total' => $max_page,
    21732173                'current' => $page,
    21742174                'echo' => true,
    2175                 'add_fragment' => '#comments'
     2175                'add_fragment' => '#comments',
     2176                'before_page_number' => '',
     2177                'after_page_number' => ''
    21762178        );
    21772179        if ( $wp_rewrite->using_permalinks() )
    21782180                $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged');