Code Duplication    Length = 27-27 lines in 2 locations

wp-includes/link-template.php 2 locations

@@ 2471-2497 (lines=27) @@
2468
 * }
2469
 * @return string Markup for posts links.
2470
 */
2471
function get_the_posts_navigation( $args = array() ) {
2472
	$navigation = '';
2473
2474
	// Don't print empty markup if there's only one page.
2475
	if ( $GLOBALS['wp_query']->max_num_pages > 1 ) {
2476
		$args = wp_parse_args( $args, array(
2477
			'prev_text'          => __( 'Older posts' ),
2478
			'next_text'          => __( 'Newer posts' ),
2479
			'screen_reader_text' => __( 'Posts navigation' ),
2480
		) );
2481
2482
		$next_link = get_previous_posts_link( $args['next_text'] );
2483
		$prev_link = get_next_posts_link( $args['prev_text'] );
2484
2485
		if ( $prev_link ) {
2486
			$navigation .= '<div class="nav-previous">' . $prev_link . '</div>';
2487
		}
2488
2489
		if ( $next_link ) {
2490
			$navigation .= '<div class="nav-next">' . $next_link . '</div>';
2491
		}
2492
2493
		$navigation = _navigation_markup( $navigation, 'posts-navigation', $args['screen_reader_text'] );
2494
	}
2495
2496
	return $navigation;
2497
}
2498
2499
/**
2500
 * Displays the navigation to next/previous set of posts, when applicable.
@@ 2812-2838 (lines=27) @@
2809
 * }
2810
 * @return string Markup for comments links.
2811
 */
2812
function get_the_comments_navigation( $args = array() ) {
2813
	$navigation = '';
2814
2815
	// Are there comments to navigate through?
2816
	if ( get_comment_pages_count() > 1 ) {
2817
		$args = wp_parse_args( $args, array(
2818
			'prev_text'          => __( 'Older comments' ),
2819
			'next_text'          => __( 'Newer comments' ),
2820
			'screen_reader_text' => __( 'Comments navigation' ),
2821
		) );
2822
2823
		$prev_link = get_previous_comments_link( $args['prev_text'] );
2824
		$next_link = get_next_comments_link( $args['next_text'] );
2825
2826
		if ( $prev_link ) {
2827
			$navigation .= '<div class="nav-previous">' . $prev_link . '</div>';
2828
		}
2829
2830
		if ( $next_link ) {
2831
			$navigation .= '<div class="nav-next">' . $next_link . '</div>';
2832
		}
2833
2834
		$navigation = _navigation_markup( $navigation, 'comment-navigation', $args['screen_reader_text'] );
2835
	}
2836
2837
	return $navigation;
2838
}
2839
2840
/**
2841
 * Displays navigation to next/previous set of comments, when applicable.