diff --git a/readme.txt b/readme.txt index 6460e47..b2835e9 100644 --- a/readme.txt +++ b/readme.txt @@ -71,6 +71,9 @@ SiteOrigin Premium includes access to our professional email support service, pe == Changelog == += 1.5.5 - 30 September 2022 = +* Added a check to ensure WP Filesystem is setup. + = 1.5.4 - 28 September 2022 = * Developer: Introduced definable Custom CSS file name and location using `siteorigin_custom_css_file` and `siteorigin_css_enqueue_css`. diff --git a/so-css.php b/so-css.php index 10cfe94..e473c51 100644 --- a/so-css.php +++ b/so-css.php @@ -31,6 +31,12 @@ function __construct() { // Main header actions add_action( 'plugins_loaded', array( $this, 'set_plugin_textdomain' ) ); + + global $wp_filesystem; + if ( ! class_exists( 'wp_filesystem' ) ) { + require_once( ABSPATH . '/wp-admin/includes/file.php' ); + WP_Filesystem(); + } // Priority 20 is necessary to ensure our CSS takes precedence. add_action( 'wp_head', array( $this, 'enqueue_css' ), 20 );