From f5db7d224addfa110bbc3c21ef3d0718e491c4a8 Mon Sep 17 00:00:00 2001 From: thrijith Date: Fri, 16 Aug 2024 17:23:07 +0530 Subject: [PATCH 1/4] Update and move two factor option heading out of table Align two factor options with title --- class-two-factor-core.php | 6 ++---- user-edit.css | 4 ++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/class-two-factor-core.php b/class-two-factor-core.php index c5864340..8131f5b2 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1405,7 +1405,7 @@ public static function _login_form_revalidate_2fa( $nonce = '', $provider = '', ) ); do_action( 'two_factor_user_revalidated', $user, $provider ); - + // Must be global because that's how login_header() uses it. global $interim_login; $interim_login = isset( $_REQUEST['interim-login'] ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited,WordPress.Security.NonceVerification.Recommended @@ -1721,12 +1721,10 @@ public static function user_two_factor_options( $user ) { wp_nonce_field( 'user_two_factor_options', '_nonce_user_two_factor_options', false ); ?> +

- + + + + + + +
- - diff --git a/user-edit.css b/user-edit.css index e5427bb7..921a39de 100644 --- a/user-edit.css +++ b/user-edit.css @@ -40,3 +40,7 @@ display: block; font-weight: 700; } + +#two-factor-options table.form-table td { + padding: 0; +} From 2642ce475d892d1b8eca893899808b536fc4b5a1 Mon Sep 17 00:00:00 2001 From: thrijith Date: Tue, 20 Aug 2024 23:30:28 +0530 Subject: [PATCH 2/4] Remove wrapping table, update css for existing table to use full width --- class-two-factor-core.php | 70 ++++++++++++++++++--------------------- user-edit.css | 5 +-- 2 files changed, 33 insertions(+), 42 deletions(-) diff --git a/class-two-factor-core.php b/class-two-factor-core.php index 8131f5b2..e2cc117c 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1723,44 +1723,38 @@ public static function user_two_factor_options( $user ) { ?>

-
- - - +
- - - - - - - - - - $object ) : ?> - - - - - - - -
/> /> - - -
-
+ + + + + + + + + $object ) : ?> + + + + + + +
/> /> + + +
Date: Thu, 22 Aug 2024 14:00:23 +1000 Subject: [PATCH 3/4] Duplicate the table header to the table footer, to match other wp-admin tables used on profiles and elsewhere. --- class-two-factor-core.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/class-two-factor-core.php b/class-two-factor-core.php index e2cc117c..ea3dc5d0 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1755,6 +1755,13 @@ public static function user_two_factor_options( $user ) {
Date: Thu, 22 Aug 2024 14:18:07 +1000 Subject: [PATCH 4/4] Use wp-admin classnames and inherit core CSS. --- class-two-factor-core.php | 2 +- user-edit.css | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/class-two-factor-core.php b/class-two-factor-core.php index ea3dc5d0..62e4019f 100644 --- a/class-two-factor-core.php +++ b/class-two-factor-core.php @@ -1723,7 +1723,7 @@ public static function user_two_factor_options( $user ) { ?>

- +
diff --git a/user-edit.css b/user-edit.css index df763894..a630f0e1 100644 --- a/user-edit.css +++ b/user-edit.css @@ -1,20 +1,3 @@ - -.two-factor-methods-table { - background-color: #fff; - border: 1px solid #e5e5e5; - border-spacing: 0; - width: 100%; -} - -.two-factor-methods-table thead, -.two-factor-methods-table tfoot { - background: #fff; -} - -.two-factor-methods-table thead th { - padding: 0.5em; -} - .two-factor-methods-table .col-primary, .two-factor-methods-table .col-enabled { width: 5%; @@ -33,10 +16,6 @@ vertical-align: top; } -.two-factor-methods-table tbody tr:nth-child(odd) { - background-color: #f9f9f9; -} - .two-factor-methods-table .two-factor-method-label { display: block; font-weight: 700;