Ticket #31315: 31315.diff
File 31315.diff, 2.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/link-template.php
2341 2341 2342 2342 // Only add markup if there's somewhere to navigate to. 2343 2343 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' ); 2345 2345 } 2346 2346 2347 2347 return $navigation; … … 2482 2482 * @param string $links Navigational links. 2483 2483 * @param string $class Optional. Custom class for nav element. Default: 'posts-navigation'. 2484 2484 * @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'. 2485 2486 * @return string Navigation template tag. 2486 2487 */ 2487 function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '' ) {2488 function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '', $context = 'posts' ) { 2488 2489 if ( empty( $screen_reader_text ) ) { 2489 2490 $screen_reader_text = __( 'Posts navigation' ); 2490 2491 } … … 2510 2511 * @since 4.4.0 2511 2512 * 2512 2513 * @param string $template The default template. 2513 * @param string $c lass The class passed by the calling function.2514 * @param string $context The type of the navigation template tag. Default 'posts'. 2514 2515 * @return string Navigation template. 2515 2516 */ 2516 $template = apply_filters( 'navigation_markup_template', $template, $c lass);2517 $template = apply_filters( 'navigation_markup_template', $template, $context ); 2517 2518 2518 2519 return sprintf( $template, sanitize_html_class( $class ), esc_html( $screen_reader_text ), $links ); 2519 2520 } … … 2741 2742 $navigation .= '<div class="nav-next">' . $next_link . '</div>'; 2742 2743 } 2743 2744 2744 $navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'] );2745 $navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'], 'comments' ); 2745 2746 } 2746 2747 2747 2748 return $navigation; … … 2786 2787 $links = paginate_comments_links( $args ); 2787 2788 2788 2789 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' ); 2790 2791 } 2791 2792 2792 2793 return $navigation;