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.


Built from https://develop.svn.wordpress.org/trunk@50117


git-svn-id: http://core.svn.wordpress.org/trunk@49796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2021-02-01 00:17:59 +00:00
parent a0d0c27eed
commit 5c4708f73f
2 changed files with 22 additions and 9 deletions

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-50116';
$wp_version = '5.7-alpha-50117';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -282,14 +282,27 @@ function login_footer( $input_id = '' ) {
// Don't allow interim logins to navigate away from the page.
if ( ! $interim_login ) {
?>
<p id="backtoblog"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php
/* translators: %s: Site title. */
printf( _x( '&larr; Go to %s', 'site' ), get_bloginfo( 'title', 'display' ) );
?>
</a></p>
<p id="backtoblog">
<?php
$html_link = sprintf(
'<a href="%s">%s</a>',
esc_url( home_url( '/' ) ),
/* translators: %s: Site title. */
sprintf(
_x( '&larr; Go to %s', 'site' ),
get_bloginfo( 'title', 'display' )
)
);
/**
* Filter the "Go to site" link displayed in the login page footer.
*
* @since 5.7.0
*
* @param string $link HTML link to the home URL of the current site.
*/
echo apply_filters( 'login_site_html_link', $html_link );
?>
</p>
<?php
the_privacy_policy_link( '<div class="privacy-policy-page-link">', '</div>' );