Skip to content

Commit fc46599

Browse files
authored
Fix LiteSpeed Cache fatal error when loading wp-admin file dependency (#2386)
1 parent 854fba6 commit fc46599

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

integration/class-litespeed-cache.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private static function append_with_markers( $marker, $rules ) {
172172
return false;
173173
}
174174

175-
// Ensure get_home_path() is declared.
175+
// Ensure WP_Filesystem() is declared.
176176
require_once ABSPATH . 'wp-admin/includes/file.php';
177177

178178
global $wp_filesystem;
@@ -211,6 +211,9 @@ private static function append_with_markers( $marker, $rules ) {
211211
private static function get_htaccess_file_path() {
212212
$htaccess_file = false;
213213

214+
// Ensure get_home_path() is declared.
215+
require_once ABSPATH . 'wp-admin/includes/file.php';
216+
214217
// phpcs:ignore WordPress.PHP.NoSilencedErrors
215218
if ( @file_exists( \get_home_path() . '.htaccess' ) ) {
216219
/** The htaccess file resides in ABSPATH */

0 commit comments

Comments
 (0)