Skip to content

Commit

Permalink
re-add preload_homepage() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabrisrp committed Jun 4, 2024
1 parent a5e3b62 commit cb6796a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
13 changes: 13 additions & 0 deletions inc/Engine/Preload/Admin/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,19 @@ public function is_enabled(): bool {
return (bool) $this->options->get( 'manual_preload', 0 );
}

/**
* Preload the homepage.
*
* @return void
*/
public function preload_homepage() {
if ( ! $this->is_enabled() ) {
return;
}

$this->preload_url->preload_url( home_url() );
}

/**
* Clear cache table and preload.
*
Expand Down
9 changes: 9 additions & 0 deletions inc/Engine/Preload/Admin/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ public function maybe_display_preload_notice() {
$this->settings->maybe_display_preload_notice();
}

/**
* Preload the homepage
*
* @return void
*/
public function preload_homepage() {
$this->settings->preload_homepage();
}

/**
* Clear the cache table and preload
*
Expand Down

0 comments on commit cb6796a

Please sign in to comment.