Make WordPress Core

Changeset 56628


Ignore:
Timestamp:
09/19/2023 10:43:38 PM (5 months ago)
Author:
costdev
Message:

Login and Registration: Introduce classes wp-login.php footer links.

This introduces classes for the "Log in", "Register" and "Lost your password?" links in the footer of wp-login.php forms so that they may be easily targeted for individual styling.

The new classes are:

  • .wp-login-log-in
  • .wp-login-register
  • .wp-login-lost-password

Props wparslan, thomasplevy, rajinsharwar, audrasjb, joedolson, costdev.
Fixes #57590.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r56352 r56628  
    862862
    863863        <p id="nav">
    864             <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
     864            <a class="wp-login-log-in" href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
    865865            <?php
    866866
    867867            if ( get_option( 'users_can_register' ) ) {
    868                 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
     868                $registration_url = sprintf( '<a class="wp-login-register" href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
    869869
    870870                echo esc_html( $login_link_separator );
     
    10081008
    10091009        <p id="nav">
    1010             <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
     1010            <a class="wp-login-log-in" href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
    10111011            <?php
    10121012
    10131013            if ( get_option( 'users_can_register' ) ) {
    1014                 $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
     1014                $registration_url = sprintf( '<a class="wp-login-register" href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
    10151015
    10161016                echo esc_html( $login_link_separator );
     
    11131113
    11141114        <p id="nav">
    1115             <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
     1115            <a class="wp-login-log-in" href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
    11161116            <?php
    11171117
    11181118            echo esc_html( $login_link_separator );
    11191119
    1120             $html_link = sprintf( '<a href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) );
     1120            $html_link = sprintf( '<a class="wp-login-lost-password" href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) );
    11211121
    11221122            /** This filter is documented in wp-login.php */
     
    14821482
    14831483                if ( get_option( 'users_can_register' ) ) {
    1484                     $registration_url = sprintf( '<a href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
     1484                    $registration_url = sprintf( '<a class="wp-login-register" href="%s">%s</a>', esc_url( wp_registration_url() ), __( 'Register' ) );
    14851485
    14861486                    /** This filter is documented in wp-includes/general-template.php */
     
    14901490                }
    14911491
    1492                 $html_link = sprintf( '<a href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) );
     1492                $html_link = sprintf( '<a class="wp-login-lost-password" href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) );
    14931493
    14941494                /**
Note: See TracChangeset for help on using the changeset viewer.