diff --git a/inc/RestApi/SettingsController.php b/inc/RestApi/SettingsController.php index bfaa1731f..3df1074a9 100644 --- a/inc/RestApi/SettingsController.php +++ b/inc/RestApi/SettingsController.php @@ -2,6 +2,8 @@ namespace Bluehost\RestApi; +use function NewfoldLabs\WP\ModuleLoader\container; + /** * Class SettingsController */ @@ -67,8 +69,11 @@ public function update_item( $request ) { $new_value = $params[ $setting ]; switch ( $setting ) { case 'comingSoon': - $new_value = ( $new_value ) ? 'true' : 'false'; - update_option( 'nfd_coming_soon', $new_value ); + if ( $new_value ) { + container()->get( 'comingSoon' )->enable(); + } else { + container()->get( 'comingSoon' )->disable(); + } break; case 'autoUpdatesMajorCore': $new_value = ( $new_value ) ? 'true' : 'false'; @@ -170,7 +175,7 @@ public function get_current_settings() { } $settings = array( - 'comingSoon' => ( 'true' === get_option( 'nfd_coming_soon', 'false' ) ), + 'comingSoon' => container()->get( 'comingSoon' )->is_enabled(), 'autoUpdatesAll' => $major && $plugins && $themes, 'autoUpdatesMajorCore' => $major, 'autoUpdatesMinorCore' => $minor,