Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch setting mm_install_date to nfd_module_onboarding_start_date #198

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions includes/Data/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
* Stores all the WordPress Options used in the module.
*/
final class Options {
/**
* Prefix for options in the module.
*
* @var string
*/
/**
* Prefix for options in the module.
*
* @var string
*/

protected static $prefix = 'nfd_module_onboarding_';

/**
* List of all the options.
*
* @var array
*/
/**
* List of all the options.
*
* @var array
*/

protected static $options = array(
'redirect' => 'redirect',
Expand All @@ -28,6 +28,7 @@ final class Options {
'close_comments_days_old' => 'close_comments_days_old',
'comments_per_page' => 'comments_per_page',
'install_date' => 'mm_install_date',
'start_date' => 'start_date',
'allow_major_auto_core_updates' => 'allow_major_auto_core_updates',
'allow_minor_auto_core_updates' => 'allow_minor_auto_core_updates',
'auto_update_plugin' => 'auto_update_plugin',
Expand Down Expand Up @@ -76,21 +77,21 @@ final class Options {
* @return string|boolean
*/
public static function get_option_name( $option_key, $attach_prefix = true ) {
return isset( self::$options[ $option_key ] )
? ( $attach_prefix
? self::$prefix . self::$options[ $option_key ]
: self::$options[ $option_key ]
)
: false;
return isset( self::$options[ $option_key ] )
? ( $attach_prefix
? self::$prefix . self::$options[ $option_key ]
: self::$options[ $option_key ]
)
: false;
}

/**
* Get the list of all options.
*
* @return array
*/
/**
* Get the list of all options.
*
* @return array
*/
public static function get_all_options() {
return self::$options;
return self::$options;
}

/**
Expand All @@ -99,6 +100,6 @@ public static function get_all_options() {
* @return array
*/
public static function get_initialization_options() {
return self::$initialization_options;
return self::$initialization_options;
}
}
2 changes: 1 addition & 1 deletion includes/RestApi/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public function initialize() {
\update_option( Options::get_option_name( $option_key, false ), $option_value );
}
// Can't be part of initialization constants as they are static.
\update_option( Options::get_option_name( 'install_date', false ), gmdate( 'M d, Y' ) );
\update_option( Options::get_option_name( 'start_date' ), gmdate( 'U' ) );

// Flush permalinks
flush_rewrite_rules();
Expand Down