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.



git-svn-id: https://develop.svn.wordpress.org/trunk@50117 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein
2021-02-01 00:16:47 +00:00
parent 66567d3191
commit 99640e3ea2

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>' );