Skip to content

Commit 8995020

Browse files
author
Oriol Arcas
committed
Bedrock support: use home URL for sitemaps
1 parent b95baaa commit 8995020

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/DetectSitemapsURLs.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DetectSitemapsURLs {
1414
* @return string[] list of URLs
1515
* @throws WP2StaticException
1616
*/
17-
public static function detect( string $wp_site_url ) : array {
17+
public static function detect() : array {
1818
$sitemaps_urls = [];
1919
$parser = new SitemapParser(
2020
'WP2Static.com',
@@ -27,14 +27,13 @@ public static function detect( string $wp_site_url ) : array {
2727
]
2828
);
2929

30-
$site_path = rtrim( SiteInfo::getURL( 'site' ), '/' );
31-
3230
$port_override = apply_filters(
3331
'wp2static_curl_port',
3432
null
3533
);
3634

37-
$base_uri = $site_path;
35+
$wp_site_url = SiteInfo::getURL( 'home' );
36+
$base_uri = rtrim($wp_site_url , '/' );
3837

3938
if ( $port_override ) {
4039
$base_uri = "{$base_uri}:{$port_override}";

src/URLDetector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public static function detectURLs() : string {
9191
$detect_sitemaps = apply_filters( 'wp2static_detect_sitemaps', 1 );
9292

9393
if ( $detect_sitemaps ) {
94-
$arrays_to_merge[] = DetectSitemapsURLs::detect( SiteInfo::getURL( 'site' ) );
94+
$arrays_to_merge[] = DetectSitemapsURLs::detect();
9595
}
9696

9797
$detect_parent_theme = apply_filters( 'wp2static_detect_parent_theme', 1 );

0 commit comments

Comments
 (0)