Code Duplication    Length = 22-22 lines in 2 locations

modules/sitemaps/sitemaps.php 2 locations

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