Skip to content

Commit

Permalink
Bedrock support: use home URL for sitemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Oriol Arcas committed Nov 20, 2021
1 parent b95baaa commit 8995020
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/DetectSitemapsURLs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DetectSitemapsURLs {
* @return string[] list of URLs
* @throws WP2StaticException
*/
public static function detect( string $wp_site_url ) : array {
public static function detect() : array {
$sitemaps_urls = [];
$parser = new SitemapParser(
'WP2Static.com',
Expand All @@ -27,14 +27,13 @@ public static function detect( string $wp_site_url ) : array {
]
);

$site_path = rtrim( SiteInfo::getURL( 'site' ), '/' );

$port_override = apply_filters(
'wp2static_curl_port',
null
);

$base_uri = $site_path;
$wp_site_url = SiteInfo::getURL( 'home' );
$base_uri = rtrim($wp_site_url , '/' );

if ( $port_override ) {
$base_uri = "{$base_uri}:{$port_override}";
Expand Down
2 changes: 1 addition & 1 deletion src/URLDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static function detectURLs() : string {
$detect_sitemaps = apply_filters( 'wp2static_detect_sitemaps', 1 );

if ( $detect_sitemaps ) {
$arrays_to_merge[] = DetectSitemapsURLs::detect( SiteInfo::getURL( 'site' ) );
$arrays_to_merge[] = DetectSitemapsURLs::detect();
}

$detect_parent_theme = apply_filters( 'wp2static_detect_parent_theme', 1 );
Expand Down

0 comments on commit 8995020

Please sign in to comment.