Make WordPress Core


Ignore:
Timestamp:
02/01/2021 12:16:47 AM (6 years ago)
Author:
adamsilverstein
Message:

Login: Enable filtering the back to blog link.

Add a new login_site_html_link filter that developers can use to adjust the "Go to site" link displayed in the login page footer.

Props ebinnion, DrewAPicture, audrasjb, hellofromTonya, sabernhardt. 
Fixes #35449.

File:
1 edited

Legend:

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

    r49992 r50117  
    283283        if ( ! $interim_login ) {
    284284                ?>
    285                 <p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    286                 <?php
    287 
    288                 /* translators: %s: Site title. */
    289                 printf( _x( '&larr; Go to %s', 'site' ), get_bloginfo( 'title', 'display' ) );
    290 
    291                 ?>
    292                 </a></p>
     285                <p id="backtoblog">
     286                        <?php
     287                        $html_link = sprintf(
     288                                '<a href="%s">%s</a>',
     289                                esc_url( home_url( '/' ) ),
     290                                /* translators: %s: Site title. */
     291                                sprintf(
     292                                        _x( '&larr; Go to %s', 'site' ),
     293                                        get_bloginfo( 'title', 'display' )
     294                                )
     295                        );
     296                        /**
     297                         * Filter the "Go to site" link displayed in the login page footer.
     298                         *
     299                         * @since 5.7.0
     300                         *
     301                         * @param string $link HTML link to the home URL of the current site.
     302                         */
     303                        echo apply_filters( 'login_site_html_link', $html_link );
     304                        ?>
     305                </p>
    293306                <?php
    294307
Note: See TracChangeset for help on using the changeset viewer.