Skip to content
Browse files

Add a login_body_class filter to login_header(). fixes #21133.

git-svn-id: http://core.svn.wordpress.org/trunk@22000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent 4e0c89c commit 71d750b450f96d259f74e35e5340fd93019e13f7 @nacin nacin committed Sep 25, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 wp-login.php
View
10 wp-login.php
@@ -39,7 +39,7 @@
* @param WP_Error $wp_error Optional. WordPress Error Object
*/
function login_header($title = 'Log In', $message = '', $wp_error = '') {
- global $error, $interim_login, $current_site;
+ global $error, $interim_login, $current_site, $action;
// Don't index any of these forms
add_action( 'login_head', 'wp_no_robots' );
@@ -86,9 +86,15 @@ function login_header($title = 'Log In', $message = '', $wp_error = '') {
if ( $interim_login )
$login_header_url = '#';
+ $classes = array( 'login-action-' . $action );
+ if ( wp_is_mobile() )
+ $classes[] = 'mobile';
+ if ( is_rtl() )
+ $classes[] = 'rtl';
+ $classes = apply_filters( 'login_body_class', $classes, $action );
?>
</head>
- <body class="login<?php if ( wp_is_mobile() ) echo ' mobile'; ?>">
+ <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
<div id="login">
<h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<?php

0 comments on commit 71d750b

Please sign in to comment.
Something went wrong with that request. Please try again.