Skip to content

Commit

Permalink
Update login css target for WordPress >= 6.7. (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
thefrosty authored Oct 17, 2024
1 parent ff36d5f commit fdbc5b5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions resources/views/wp-login/style.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
exit;
}

if (!defined('SHORTINIT')) {
define('SHORTINIT', true);
}

$login_h1 = version_compare($GLOBALS['wp_version'], '6.7', '>=') ? '.login .wp-login-logo' : '.login h1';
$version ??= CustomLogin::VERSION;
$close_rule = "}\n";

Expand Down Expand Up @@ -136,20 +133,20 @@

/**
* Open login h1
* @rule .login h1
* @rule .login h1 / .login .wp-login-logo
*/
if ((!empty($logo_force_form_max_width) && $logo_force_form_max_width === OptionValue::ON) && !empty($login_form_width)) {
$css .= openCssRule('.login h1');
$css .= openCssRule($login_h1);
$css .= trailingSemicolonIt('width', sprintf('%1$s%2$s', $login_form_width, $login_form_width_unit ?? 'px'));
$css .= $close_rule; // CLOSE .login
$css .= $close_rule; // CLOSE .login h1 / .login .wp-login-logo
}

/**
* Open login h1 a
* @rule .login h1 a
* @rule .login h1 a / .login .wp-login-logo a
*/
if (!empty($logo_background_url)) {
$css .= openCssRule('.login h1 a');
$css .= openCssRule("$login_h1 a");
if (!empty($logo_background_size_width)) {
$css .= trailingSemicolonIt('width', sprintf('%1$spx !important', $logo_background_size_width));
}
Expand All @@ -167,7 +164,7 @@
} else {
$css .= prefixIt('background-size', 'inherit');
}
$css .= $close_rule; // CLOSE .login h1 a
$css .= $close_rule; // CLOSE .login h1 a / .login .wp-login-logo a
}

/**
Expand Down

0 comments on commit fdbc5b5

Please sign in to comment.