Make WordPress Core

Ticket #31315: 31315.diff

File 31315.diff, 2.5 KB (added by obenland, 10 years ago)
  • src/wp-includes/link-template.php

     
    23412341
    23422342        // Only add markup if there's somewhere to navigate to.
    23432343        if ( $previous || $next ) {
    2344                 $navigation = _navigation_markup( $previous . $next, 'post-navigation', $args['screen_reader_text'] );
     2344                $navigation = _navigation_markup( $previous . $next, 'post-navigation', $args['screen_reader_text'], 'post' );
    23452345        }
    23462346
    23472347        return $navigation;
     
    24822482 * @param string $links              Navigational links.
    24832483 * @param string $class              Optional. Custom class for nav element. Default: 'posts-navigation'.
    24842484 * @param string $screen_reader_text Optional. Screen reader text for nav element. Default: 'Posts navigation'.
     2485 * @param string $context            Optional. The type of the navigation template tag. Default: 'posts'.
    24852486 * @return string Navigation template tag.
    24862487 */
    2487 function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '' ) {
     2488function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '', $context = 'posts' ) {
    24882489        if ( empty( $screen_reader_text ) ) {
    24892490                $screen_reader_text = __( 'Posts navigation' );
    24902491        }
     
    25102511         * @since 4.4.0
    25112512         *
    25122513         * @param string $template The default template.
    2513          * @param string $class    The class passed by the calling function.
     2514         * @param string $context  The type of the navigation template tag. Default 'posts'.
    25142515         * @return string Navigation template.
    25152516         */
    2516         $template = apply_filters( 'navigation_markup_template', $template, $class );
     2517        $template = apply_filters( 'navigation_markup_template', $template, $context );
    25172518
    25182519        return sprintf( $template, sanitize_html_class( $class ), esc_html( $screen_reader_text ), $links );
    25192520}
     
    27412742                        $navigation .= '<div class="nav-next">' . $next_link . '</div>';
    27422743                }
    27432744
    2744                 $navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'] );
     2745                $navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'], 'comments' );
    27452746        }
    27462747
    27472748        return $navigation;
     
    27862787        $links = paginate_comments_links( $args );
    27872788
    27882789        if ( $links ) {
    2789                 $navigation = _navigation_markup( $links, 'comments-pagination', $args['screen_reader_text'] );
     2790                $navigation = _navigation_markup( $links, 'comments-pagination', $args['screen_reader_text'], 'comments' );
    27902791        }
    27912792
    27922793        return $navigation;