Skip to content

Commit

Permalink
Merge pull request #6128 from Automattic/develop
Browse files Browse the repository at this point in the history
Staging release: v20250204.2
  • Loading branch information
rinatkhaziev authored Feb 4, 2025
2 parents e19148c + 974b4a4 commit 3f9ec70
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ class Two_Factor_Backup_Codes extends Two_Factor_Provider {
*/
const NUMBER_OF_CODES = 10;

public static function get_instance() {
static $instance;
$class = __CLASS__;
if ( ! is_a( $instance, $class ) ) {
$instance = new $class();
}
return $instance;
}

/**
* Class constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ class Two_Factor_Email extends Two_Factor_Provider {
*/
const INPUT_NAME_RESEND_CODE = 'two-factor-email-code-resend';

public static function get_instance() {
static $instance;
$class = __CLASS__;
if ( ! is_a( $instance, $class ) ) {
$instance = new $class();
}
return $instance;
}

/**
* Class constructor.
*
Expand Down
9 changes: 9 additions & 0 deletions shared-plugins/two-factor/providers/class-two-factor-totp.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ class Two_Factor_Totp extends Two_Factor_Provider {
*/
private static $base_32_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';

public static function get_instance() {
static $instance;
$class = __CLASS__;
if ( ! is_a( $instance, $class ) ) {
$instance = new $class();
}
return $instance;
}

/**
* Class constructor. Sets up hooks, etc.
*
Expand Down

0 comments on commit 3f9ec70

Please sign in to comment.