From e3c897c4ae125941bf0aade1b1c796125a058214 Mon Sep 17 00:00:00 2001 From: vladstanca Date: Sat, 7 Jan 2023 18:19:58 -0600 Subject: [PATCH] Add support for XSL files (#881) --- CHANGELOG.md | 1 + src/FileProcessor.php | 3 +++ src/WordPressAdmin.php | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6298daaba..2b787dc30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - [#877](https://github.com/leonstafford/wp2static/issues/877): Detect from web UI was not adding any URLs. @timothylcooke - [#878](https://github.com/leonstafford/wp2static/issues/878): Fix deletion of old pages when crawl returns 404. @timothylcooke - [#868](https://github.com/WP2Static/wp2static/pull/868): Detect files in Divi et-cache/ directory when present. @dunklerfox + - [#881](https://github.com/WP2Static/wp2static/pull/881): Crawl XSL files. @vladstanca ## WP2Static 7.1.7 (2021-09-04) diff --git a/src/FileProcessor.php b/src/FileProcessor.php index 1a5699e58..e706ce88d 100755 --- a/src/FileProcessor.php +++ b/src/FileProcessor.php @@ -42,6 +42,9 @@ public function processFile( string $filename ) : void { case 'xml': do_action( 'wp2static_process_xml', $filename ); break; + case 'xsl': + do_action( 'wp2static_process_xsl', $filename ); + break; } } } diff --git a/src/WordPressAdmin.php b/src/WordPressAdmin.php index 27b06cee8..d56428d0e 100755 --- a/src/WordPressAdmin.php +++ b/src/WordPressAdmin.php @@ -281,6 +281,13 @@ public static function registerHooks( string $bootstrap_file ) : void { 1 ); + add_action( + 'wp2static_process_xsl', + [ SimpleRewriter::class, 'rewrite' ], + 10, + 1 + ); + add_action( 'save_post', [ Controller::class, 'wp2staticSavePostHandler' ],