Ticket #24709: 24709.2.patch
File 24709.2.patch, 2.7 KB (added by , 11 years ago) |
---|
-
wp-includes/general-template.php
1983 1983 * It is possible to add query vars to the link by using the 'add_args' argument 1984 1984 * and see {@link add_query_arg()} for more information. 1985 1985 * 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 * 1986 1992 * @since 2.1.0 1987 1993 * 1988 1994 * @param string|array $args Optional. Override defaults. … … 2002 2008 'mid_size' => 2, 2003 2009 'type' => 'plain', 2004 2010 'add_args' => false, // array of query args to add 2005 'add_fragment' => '' 2011 'add_fragment' => '', 2012 'before_page_number' => '', 2013 'after_page_number' => '' 2006 2014 ); 2007 2015 2008 2016 $args = wp_parse_args( $args, $defaults ); … … 2032 2040 for ( $n = 1; $n <= $total; $n++ ) : 2033 2041 $n_display = number_format_i18n($n); 2034 2042 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>"; 2036 2044 $dots = true; 2037 2045 else : 2038 2046 if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : … … 2041 2049 if ( $add_args ) 2042 2050 $link = add_query_arg( $add_args, $link ); 2043 2051 $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>"; 2045 2053 $dots = true; 2046 2054 elseif ( $dots && !$show_all ) : 2047 2055 $page_links[] = '<span class="page-numbers dots">' . __( '…' ) . '</span>'; -
wp-includes/link-template.php
2172 2172 'total' => $max_page, 2173 2173 'current' => $page, 2174 2174 'echo' => true, 2175 'add_fragment' => '#comments' 2175 'add_fragment' => '#comments', 2176 'before_page_number' => '', 2177 'after_page_number' => '' 2176 2178 ); 2177 2179 if ( $wp_rewrite->using_permalinks() ) 2178 2180 $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged');