Code Duplication    Length = 22-22 lines in 2 locations

modules/sitemaps/sitemaps.php 2 locations

@@ 628-649 (lines=22) @@
625
 *
626
 * @return string Sitemap URL.
627
 */
628
function jetpack_sitemap_uri() {
629
	global $wp_rewrite;
630
631
	if ( $wp_rewrite->using_index_permalinks() ) {
632
		$sitemap_url = home_url( '/index.php/sitemap.xml' );
633
	} else if ( $wp_rewrite->using_permalinks() ) {
634
		$sitemap_url = home_url( '/sitemap.xml' );
635
	} else {
636
		$sitemap_url = home_url( '/?jetpack-sitemap=true' );
637
	}
638
639
	/**
640
	 * Filter sitemap URL relative to home URL.
641
	 *
642
	 * @module sitemaps
643
	 *
644
	 * @since 3.9.0
645
	 *
646
	 * @param string $sitemap_url Sitemap URL.
647
	 */
648
	return apply_filters( 'jetpack_sitemap_location', $sitemap_url );
649
}
650
651
/**
652
 * Absolute URL of the current blog's news sitemap.
@@ 656-677 (lines=22) @@
653
 *
654
 * @module sitemaps
655
 */
656
function jetpack_news_sitemap_uri() {
657
	global $wp_rewrite;
658
659
	if ( $wp_rewrite->using_index_permalinks() ) {
660
		$news_sitemap_url = home_url( '/index.php/news-sitemap.xml' );
661
	} else if ( $wp_rewrite->using_permalinks() ) {
662
		$news_sitemap_url = home_url( '/news-sitemap.xml' );
663
	} else {
664
		$news_sitemap_url = home_url( '/?jetpack-news-sitemap=true' );
665
	}
666
667
	/**
668
	 * Filter news sitemap URL relative to home URL.
669
	 *
670
	 * @module sitemaps
671
	 *
672
	 * @since 3.9.0
673
	 *
674
	 * @param string $news_sitemap_url News sitemap URL.
675
	 */
676
	return apply_filters( 'jetpack_news_sitemap_location', $news_sitemap_url );
677
}
678
679
/**
680
 * Output the default sitemap URL.