Make WordPress Core

Changeset 27600


Ignore:
Timestamp:
03/18/2014 11:30:55 PM (11 years ago)
Author:
johnbillion
Message:

Introduce before_page_number and after_page_number arguments for paginate_links(). Fixes #24709. Props grahamarmfield.

File:
1 edited

Legend:

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

    r27523 r27600  
    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 *
     
    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
     
    20322040    for ( $n = 1; $n <= $total; $n++ ) :
    20332041        if ( $n == $current ) :
    2034             $page_links[] = "<span class='page-numbers current'>" . number_format_i18n($n) . "</span>";
     2042            $page_links[] = "<span class='page-numbers current'>" . $before_page_number . number_format_i18n( $n ) . $after_page_number . "</span>";
    20352043            $dots = true;
    20362044        else :
     
    20412049                    $link = add_query_arg( $add_args, $link );
    20422050                $link .= $add_fragment;
    2043                 $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . number_format_i18n($n) . "</a>";
     2051                $page_links[] = "<a class='page-numbers' href='" . esc_url( apply_filters( 'paginate_links', $link ) ) . "'>" . $before_page_number . number_format_i18n( $n ) . $after_page_number . "</a>";
    20442052                $dots = true;
    20452053            elseif ( $dots && !$show_all ) :
Note: See TracChangeset for help on using the changeset viewer.