/** * Returns the single instance of the Jetpack_SSO object * * @since 2.8 * @return Jetpack_SSO **/ public static function get_instance() { if (!is_null(self::$instance)) { return self::$instance; } return self::$instance = new Jetpack_SSO(); }
function __construct() { if (self::$instance) { return self::$instance; } self::$instance = $this; add_action('admin_init', array($this, 'admin_init')); add_action('login_init', array($this, 'login_init')); add_action('delete_user', array($this, 'delete_connection_for_user')); }
function jetpack_set_two_step_for_admins($user_data) { $user = Jetpack_SSO::get_user_by_wpcom_id($user_data->ID); // Borrowed from Jetpack. Ignores the match_by_email setting. if (empty($user)) { $user = get_user_by('email', $user_data->email); } if ($user && $user->has_cap('manage_options')) { add_filter('jetpack_sso_require_two_step', '__return_true'); } }