Code Duplication    Length = 22-22 lines in 2 locations

modules/sitemaps/sitemaps.php 2 locations

@@ 614-635 (lines=22) @@
611
 *
612
 * @return string Sitemap URL.
613
 */
614
function jetpack_sitemap_uri() {
615
	global $wp_rewrite;
616
617
	if ( $wp_rewrite->using_index_permalinks() ) {
618
		$sitemap_url = home_url( '/index.php/sitemap.xml' );
619
	} else if ( $wp_rewrite->using_permalinks() ) {
620
		$sitemap_url = home_url( '/sitemap.xml' );
621
	} else {
622
		$sitemap_url = home_url( '/?jetpack-sitemap=true' );
623
	}
624
625
	/**
626
	 * Filter sitemap URL relative to home URL.
627
	 *
628
	 * @module sitemaps
629
	 *
630
	 * @since 3.9.0
631
	 *
632
	 * @param string $sitemap_url Sitemap URL.
633
	 */
634
	return apply_filters( 'jetpack_sitemap_location', $sitemap_url );
635
}
636
637
/**
638
 * Absolute URL of the current blog's news sitemap.
@@ 642-663 (lines=22) @@
639
 *
640
 * @module sitemaps
641
 */
642
function jetpack_news_sitemap_uri() {
643
	global $wp_rewrite;
644
645
	if ( $wp_rewrite->using_index_permalinks() ) {
646
		$news_sitemap_url = home_url( '/index.php/news-sitemap.xml' );
647
	} else if ( $wp_rewrite->using_permalinks() ) {
648
		$news_sitemap_url = home_url( '/news-sitemap.xml' );
649
	} else {
650
		$news_sitemap_url = home_url( '/?jetpack-news-sitemap=true' );
651
	}
652
653
	/**
654
	 * Filter news sitemap URL relative to home URL.
655
	 *
656
	 * @module sitemaps
657
	 *
658
	 * @since 3.9.0
659
	 *
660
	 * @param string $news_sitemap_url News sitemap URL.
661
	 */
662
	return apply_filters( 'jetpack_news_sitemap_location', $news_sitemap_url );
663
}
664
665
/**
666
 * Output the default sitemap URL.