Make WordPress Core

Ticket #41859: 41859.patch

File 41859.patch, 2.2 KB (added by antonioeatgoat, 8 years ago)

Improved default parameters and highlighted current item

  • src/wp-includes/post-template.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    841841 *                                          Also prepended to the current item, which is not linked. Default empty.
    842842 *     @type string       $link_after       HTML or text to append to each Pages link inside the `<a>` tag.
    843843 *                                          Also appended to the current item, which is not linked. Default empty.
     844 *     @type string       $aria_current     The value for the aria-current attribute. Possible values are 'page',
     845 *                                          'step', 'location', 'date', 'time', 'true', 'false'. Default is 'page'.
    844846 *     @type string       $next_or_number   Indicates whether page numbers should be used. Valid values are number
    845847 *                                          and next. Default is 'number'.
    846848 *     @type string       $separator        Text between pagination links. Default is ' '.
     
    857859        global $page, $numpages, $multipage, $more;
    858860
    859861        $defaults = array(
    860                 'before'           => '<p>' . __( 'Pages:' ),
    861                 'after'            => '</p>',
     862                'before'           => '<div class="page-links">' . __( 'Pages:' ),
     863                'after'            => '</div>',
    862864                'link_before'      => '',
    863865                'link_after'       => '',
     866                'aria_current'     => 'page',
    864867                'next_or_number'   => 'number',
    865868                'separator'        => ' ',
    866869                'nextpagelink'     => __( 'Next page' ),
     
    888891                                $link = $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after'];
    889892                                if ( $i != $page || ! $more && 1 == $page ) {
    890893                                        $link = _wp_link_page( $i ) . $link . '</a>';
     894                                        $link = str_replace( '<a href="', '<a class="page-number" href="', $link );
     895                                } else if ( $i == $page ) {
     896                                        $link = '<span class="page-number current" aria-current="' . esc_attr( $r['aria_current'] ) . '">' . $link . '</span>';
    891897                                }
    892898                                /**
    893899                                 * Filters the HTML output of individual page number links.