From b472c5414b093a89c593f3d01faf574e8b7e08cf Mon Sep 17 00:00:00 2001 From: Daniel Korte Date: Wed, 26 Jan 2022 14:43:48 -0600 Subject: [PATCH] Fix PHP Error: Fatal error: Uncaught TypeError: unlink(): Argument #2 Fatal error: Uncaught TypeError: unlink(): Argument #2 ($context) must be of type resource or null, bool given https://www.php.net/manual/en/function.unlink.php --- inc/class-sc-config.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/class-sc-config.php b/inc/class-sc-config.php index aa2ce27..f29dc74 100644 --- a/inc/class-sc-config.php +++ b/inc/class-sc-config.php @@ -179,7 +179,7 @@ public function write( $config, $force_network = false ) { // Delete network config if not network activated if ( 'config-network.php' !== $file_name ) { - @unlink( $config_dir . '/config-network.php', true ); + @unlink( $config_dir . '/config-network.php' ); } return true; @@ -217,7 +217,7 @@ public function clean_up() { delete_option( 'sc_simple_cache' ); } - @unlink( $config_dir . '/config-network.php', true ); + @unlink( $config_dir . '/config-network.php' ); if ( ! @unlink( $config_dir . '/' . $this->get_config_file_name() ) ) { return false;