Remove the login box frame and hide "Lost your password?" reliably
Some checks are pending
CI / PHP lint (7.4) (pull_request) Waiting to run
CI / PHP lint (8.0) (pull_request) Waiting to run
CI / PHP lint (8.1) (pull_request) Waiting to run
CI / PHP lint (8.2) (pull_request) Waiting to run
CI / PHP lint (8.3) (pull_request) Waiting to run
CI / PHP lint (8.4) (pull_request) Waiting to run
CI / WordPress Coding Standards (pull_request) Waiting to run
CI / WordPress.org Plugin Check (pull_request) Waiting to run

- No border or shadow around the login box on wp-login.php (form and
  Microsoft block, also in button-only mode); the white area stays.
- Button-only mode: the "Lost your password?" link is removed through
  lost_password_html_link instead of CSS only, the lostpassword,
  retrievepassword, rp and resetpass screens redirect to the login page
  and allow_password_reset refuses resets – all unless the fallback link
  is active.
- The login stylesheet is also loaded when only the form is hidden
  (e.g. broken connection); before, the link and form showed there.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-24 04:30:13 +00:00
parent cc88f145f2
commit 7749ebff9b
10 changed files with 377 additions and 301 deletions

View file

@ -12,13 +12,14 @@
background: #fff;
padding: 0 24px 26px;
margin: -1px 0 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
border: 1px solid #c3c4c7;
border-top: 0;
border: 0;
box-shadow: none;
}
/* No frame around the login box: neither around the form nor around the Microsoft block. */
body.m365-login-page #loginform,
body.m365-login-attached #loginform {
border-bottom: 0;
border: 0;
box-shadow: none;
}
@ -26,8 +27,8 @@ body.m365-login-attached #loginform {
background: #fff;
padding: 24px;
margin: 20px 0 0;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
border: 1px solid #c3c4c7;
border: 0;
box-shadow: none;
}
.m365-login--above .m365-login__divider {
@ -123,16 +124,18 @@ body.m365-login-attached #loginform {
/* Button-only mode: the password form is hidden until the fallback key is used. */
body.m365-button-only #loginform,
body.m365-button-only #nav {
display: none;
body.m365-button-only #nav,
body.m365-button-only a[href*="action=lostpassword"],
body.m365-button-only .wp-login-lost-password {
display: none !important;
}
body.m365-button-only .m365-login--below,
body.m365-button-only .m365-login--above {
margin-top: 20px;
padding: 26px 24px;
border: 1px solid #c3c4c7;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
border: 0;
box-shadow: none;
}
/* Custom login pages: wp_login_form() injection, shortcode and template function. */