Make WordPress Core

Changeset 22000


Ignore:
Timestamp:
09/25/2012 09:13:06 AM (13 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r21996 r22000  
    4040 */
    4141function login_header($title = 'Log In', $message = '', $wp_error = '') {
    42     global $error, $interim_login, $current_site;
     42    global $error, $interim_login, $current_site, $action;
    4343
    4444    // Don't index any of these forms
     
    8787        $login_header_url = '#';
    8888
     89    $classes = array( 'login-action-' . $action );
     90    if ( wp_is_mobile() )
     91        $classes[] = 'mobile';
     92    if ( is_rtl() )
     93        $classes[] = 'rtl';
     94    $classes = apply_filters( 'login_body_class', $classes, $action );
    8995    ?>
    9096    </head>
    91     <body class="login<?php if ( wp_is_mobile() ) echo ' mobile'; ?>">
     97    <body class="login <?php echo esc_attr( implode( ' ', $classes ) ); ?>">
    9298    <div id="login">
    9399        <h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
Note: See TracChangeset for help on using the changeset viewer.