From 077e9b8d3ca505ba209c55bab23b44066e246600 Mon Sep 17 00:00:00 2001 From: nixpanel Date: Sat, 4 Jul 2026 04:22:10 -0500 Subject: [PATCH] Implement Settings > Login's page styling (v2.2.0) "Style login page" and "Login logo" existed in the Settings UI with no implementation behind them at all. New LoginStyle class hooks login_enqueue_scripts to apply a dark theme (background, form card, inputs, button) and swap in the configured logo, linked to the site's home URL instead of wordpress.org. Co-Authored-By: Claude Sonnet 5 --- CHANGELOG.md | 10 +++ admin/src/App/AuroraAdmin.php | 2 + admin/src/Login/LoginStyle.php | 122 +++++++++++++++++++++++++++++++++ app/package.json | 2 +- aurora-admin.php | 5 +- 5 files changed, 138 insertions(+), 3 deletions(-) create mode 100644 admin/src/Login/LoginStyle.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 67f57c0..16f9f70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ version bump. Starts at 2.1.0 — earlier history (the theming rebuild, window chrome/taskbar, Site Editor support, etc.) lives in `git log` and `PROJECT_STATUS.md`, not reconstructed here. +## [2.2.0] - 2026-07-04 + +### Added +- Settings > Login's "Style login page" and "Login logo" fields now + actually do something — previously they existed in the UI with no + implementation behind them at all. Styles `wp-login.php` with a dark + theme (background, card, inputs, button) and swaps in the configured + logo image in place of the WordPress logo, linked to the site's home + URL instead of wordpress.org. + ## [2.1.1] - 2026-07-04 ### Fixed diff --git a/admin/src/App/AuroraAdmin.php b/admin/src/App/AuroraAdmin.php index f37ddcd..4ef3a89 100644 --- a/admin/src/App/AuroraAdmin.php +++ b/admin/src/App/AuroraAdmin.php @@ -22,6 +22,7 @@ use AuroraAdmin\Roles\RolesData; use AuroraAdmin\ActivityLog\ActivityLog; use AuroraAdmin\ActivityLog\ActivityLogData; use AuroraAdmin\DatabaseExplorer\DatabaseExplorerData; +use AuroraAdmin\Login\LoginStyle; defined("ABSPATH") || exit(); @@ -56,5 +57,6 @@ class AuroraAdmin new ActivityLog(); new ActivityLogData(); new DatabaseExplorerData(); + new LoginStyle(); } } diff --git a/admin/src/Login/LoginStyle.php b/admin/src/Login/LoginStyle.php new file mode 100644 index 0000000..d4cc67a --- /dev/null +++ b/admin/src/Login/LoginStyle.php @@ -0,0 +1,122 @@ + Login's "Style login page" and "Login logo" fields to + * wp-login.php. Both settings existed in the UI with no implementation + * behind them until now — this is that implementation. + * + * Deliberately a single fixed dark theme rather than reusing the admin + * shell's per-preset palette system (themePresets.js): the login screen + * loads independently of wp-admin, so none of the --aurora-* CSS variables + * set on html.aurora-ready are available there, and duplicating the + * hue-ramp logic in PHP just to match whichever preset happens to be + * selected wasn't worth the upkeep for a first pass. + */ +class LoginStyle +{ + public function __construct() + { + add_action("login_enqueue_scripts", [self::class, "print_styles"]); + add_filter("login_headerurl", [self::class, "header_url"]); + } + + private static function enabled() + { + return (bool) Settings::get("style_login", false); + } + + public static function header_url($url) + { + return self::enabled() ? home_url("/") : $url; + } + + public static function print_styles() + { + if (!self::enabled()) { + return; + } + + $logo = trim((string) Settings::get("login_logo", "")); + ?> + +