diff --git a/src/Installation/Activation.php b/src/Installation/Activation.php index 3b141b3..ae0babb 100644 --- a/src/Installation/Activation.php +++ b/src/Installation/Activation.php @@ -41,7 +41,15 @@ public function set_first_install_options(): void { \add_option( 'gtmkit_initial_version', GTMKIT_VERSION, '', false ); \update_option( 'gtmkit_version', GTMKIT_VERSION, false ); - Options::init()->set( Options::get_defaults( true ), true ); + $map = Options::get_defaults(); + $defaults = []; + foreach ( $map as $group => $settings ) { + foreach ( $settings as $key => $option ) { + $defaults[ $group ][ $key ] = $option['default']; + } + } + + Options::init()->set( $defaults, true ); // Add transient to trigger redirect to the Setup Wizard. \set_transient( 'gtmkit_activation_redirect', true, 30 ); diff --git a/src/Options.php b/src/Options.php index 1517ae8..c934123 100644 --- a/src/Options.php +++ b/src/Options.php @@ -122,24 +122,12 @@ public function pre_update_option( $new_value, $old_value ): ?array { /** * The default options. * - * @param bool $flat Flattens the default settings for first install. - * * @return array */ - public static function get_defaults( bool $flat = false ): array { + public static function get_defaults(): array { $map = self::$map; - if ( $flat === true ) { - $defaults = []; - foreach ( $map as $group => $settings ) { - foreach ( $settings as $key => $option ) { - $defaults[ $group ][ $key ] = $option['default']; - } - } - return $defaults; - } - return $map; }