Skip to content

Commit

Permalink
Merge pull request #124 from NightJar/hooks
Browse files Browse the repository at this point in the history
Add extension hooks for static file writing
  • Loading branch information
GuySartorelli authored Oct 23, 2024
2 parents 5510305 + 648cd87 commit 490bfe5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ErrorPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public function writeStaticPage()
// Run the page (reset the theme, it might've been disabled by LeftAndMain::init())
$originalThemes = SSViewer::get_themes();
try {
$this->extend('onBeforeStaticWrite');
// Restore front-end themes from config
$themes = SSViewer::config()->get('themes') ?: $originalThemes;
SSViewer::set_themes($themes);
Expand All @@ -336,6 +337,7 @@ public function writeStaticPage()
} finally {
// Restore themes
SSViewer::set_themes($originalThemes);
$this->extend('onAfterStaticWrite');
}

// Make sure we have content to save
Expand Down

0 comments on commit 490bfe5

Please sign in to comment.