Skip to content

Commit b1f29e0

Browse files
committed
Add processedSitePath option
- Add processedSitePath option that can be configured and filtered by option hooks. - Remove separate processed_site_path hook.
1 parent e6b799a commit b1f29e0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/ProcessedSite.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
class ProcessedSite {
1515

1616
public static function getPath(): string {
17-
return apply_filters(
18-
Controller::getHookName( 'processed_site_path' ),
19-
SiteInfo::getPath( 'uploads' ) . 'wp2static-processed-site'
20-
);
17+
return SiteInfo::getPath( 'uploads' ) .
18+
CoreOptions::getValue( 'processedSitePath' );
2119
}
2220

2321
/**

tests/integration/ITTrait.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public function getCrawledFileContents( string $path ): string
5959
public function getProcessedFileContents( string $path ): string
6060
{
6161
$wordpress_dir = ITEnv::getWordPressDir();
62-
$processed_site_dir = $wordpress_dir . '/wp-content/uploads/wp2static-processed-site';
62+
$processed_site_dir = $wordpress_dir .
63+
'/wp-content/uploads/' .
64+
$this->getOptionValue( 'processedSitePath' );
6365
$content = file_get_contents( "{$processed_site_dir}/$path" );
6466
$this->assertNotFalse( $content, "Failed to read file: {$processed_site_dir}/$path" );
6567
return $content;

views/caches-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@
141141
<td><?php echo $processed_site_file_count; ?> files, using <?php echo $processed_site_disk_space; ?>
142142
<br>
143143

144-
<a href="file://<?php echo $uploads_path; ?>wp2static-processed-site" />Path</a>
144+
<a href="file://<?php echo \WP2Static\ProcessedSite::getPath(); ?>" />Path</a>
145145
</td>
146146
<td>
147147
<form

0 commit comments

Comments
 (0)