File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -368,10 +368,9 @@ public static function getTotal(): int {
368368 }
369369
370370 /**
371- * @param mixed[] $redirs
372371 * @return mixed[] redirects
373372 */
374- public static function wp2static_list_redirects ( array $ redirs ): array {
373+ public static function listRedirects ( ): array {
375374 global $ wpdb ;
376375
377376 $ table_name = self ::getTableName ();
@@ -380,6 +379,7 @@ public static function wp2static_list_redirects( array $redirs ): array {
380379 "SELECT path, redirect_to FROM $ table_name WHERE 0 < LENGTH(redirect_to) "
381380 );
382381
382+ $ redirs = [];
383383 foreach ( $ rows as $ row ) {
384384 $ redirs [ $ row ->path ] = [
385385 'url ' => $ row ->path ,
Original file line number Diff line number Diff line change 99use Aws \Credentials \Credentials ;
1010use Aws \Exception \AwsException ;
1111use Aws \S3 \S3Client ;
12+ use WP2Static \CrawledFiles ;
1213use WP2Static \Options ;
1314use WP2Static \WsLog ;
1415
@@ -102,7 +103,7 @@ public function uploadFiles( string $processed_site_path ): void {
102103 }
103104 };
104105
105- $ redirects = apply_filters ( ' wp2static_list_redirects ' , [] );
106+ $ redirects = CrawledFiles:: listRedirects ( );
106107
107108 self ::uploadFilesIter ( $ file_arrays ( $ files , $ redirects ) );
108109 }
Original file line number Diff line number Diff line change @@ -55,11 +55,6 @@ public static function registerHooks( string $bootstrap_file ): void {
5555 [ WPCron::class, 'wp2static_custom_cron_schedules ' ]
5656 );
5757
58- add_filter (
59- Controller::getHookName ( 'list_redirects ' ),
60- [ CrawledFiles::class, 'wp2static_list_redirects ' ]
61- );
62-
6358 add_filter (
6459 'cron_request ' ,
6560 [ WPCron::class, 'wp2static_cron_with_http_basic_auth ' ]
You can’t perform that action at this time.
0 commit comments