From b0c40f74d45fbbc9a2b31174f61c223e2adfc7b2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 2 Oct 2017 22:59:25 +0000 Subject: [PATCH] Login and Registration: Introduce `login_title` filter for the `` tag content on login page. The new filter mirrors the `admin_title` filter used on admin pages. Props nishitlangaliya, henry.wright, SergeyBiryukov. Fixes #40812. git-svn-id: https://develop.svn.wordpress.org/trunk@41691 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-login.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/wp-login.php b/src/wp-login.php index 3db48622e7..869502414b 100644 --- a/src/wp-login.php +++ b/src/wp-login.php @@ -55,7 +55,20 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { if ( $shake_error_codes && $wp_error->get_error_code() && in_array( $wp_error->get_error_code(), $shake_error_codes ) ) add_action( 'login_head', 'wp_shake_js', 12 ); - $separator = is_rtl() ? ' › ' : ' ‹ '; + $login_title = get_bloginfo( 'name', 'display' ); + + /* translators: Login screen title. 1: Login screen name, 2: Network or site name */ + $login_title = sprintf( __( '%1$s ‹ %2$s — WordPress' ), $title, $login_title ); + + /** + * Filters the title tag content for login page. + * + * @since 4.9.0 + * + * @param string $login_title The page title, with extra context added. + * @param string $title The original page title. + */ + $login_title = apply_filters( 'login_title', $login_title, $title ); ?><!DOCTYPE html> <!--[if IE 8]> @@ -66,7 +79,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = '' ) { <!--<![endif]--> <head> <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" /> - <title><?php echo $title . $separator . get_bloginfo( 'name', 'display' ); ?> + <?php echo $login_title; ?>