Skip to content

Commit

Permalink
Add WP_Filesystem Dependency Check
Browse files Browse the repository at this point in the history
### Added
- Check for existence of 'WP_Filesystem' function before instantiation.
  • Loading branch information
smileBeda committed May 29, 2024

Verified

This commit was signed with the committer’s verified signature.
jalling97 John Alling
1 parent f61d092 commit 10d9c90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/src/utilities/class-wp-filesystem-utility.php
Original file line number Diff line number Diff line change
@@ -72,6 +72,9 @@ public static function get_filesystem(): object {

if ( null === self::$filesystem ) {

if ( ! function_exists( 'WP_Filesystem' ) ) {
require_once 'wp-admin/includes/file.php';
}
WP_Filesystem();
self::$filesystem = new \WP_Filesystem_Direct( true );
}

0 comments on commit 10d9c90

Please sign in to comment.