• About WordPress
    • About WordPress
    • WordPress.org
    • Documentation
    • Support
    • Feedback
  • Log In
  • Register
WordPress.org
WordPress.org
  • Plugins
  • Themes
  • Patterns
  • Learn
  • Support
    • Documentation
    • Forums
  • News
  • About
  • Get Involved
    • Five for the Future
  • Showcase
  • Mobile
  • Hosting
  • Openverse
  • Get WordPress
Get WordPress

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Reference / Functions / login_footer()

login_footer( string $input_id = '' )

Outputs the footer for the login page.

Contents

  • Parameters
  • Source
  • Related
    • Uses
  • Changelog
  • User Contributed Notes

Parameters

$input_id

(string) (Optional) Which input to auto-focus.

Default value: ''


Top ↑

Source

File: wp-login.php

function login_footer( $input_id = '' ) {
	global $interim_login;

	// Don't allow interim logins to navigate away from the page.
	if ( ! $interim_login ) {
		?>
		<p id="backtoblog">
			<?php
			$html_link = sprintf(
				'<a href="%s">%s</a>',
				esc_url( home_url( '/' ) ),
				sprintf(
					/* translators: %s: Site title. */
					_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>' );
	}

	?>
	</div><?php // End of <div id="login">. ?>

	<?php
	if (
		! $interim_login &&
		/**
		 * Filters the Languages select input activation on the login screen.
		 *
		 * @since 5.9.0
		 *
		 * @param bool Whether to display the Languages select input on the login screen.
		 */
		apply_filters( 'login_display_language_dropdown', true )
	) {
		$languages = get_available_languages();

		if ( ! empty( $languages ) ) {
			?>
			<div class="language-switcher">
				<form id="language-switcher" action="" method="get">

					<label for="language-switcher-locales">
						<span class="dashicons dashicons-translation" aria-hidden="true"></span>
						<span class="screen-reader-text"><?php _e( 'Language' ); ?></span>
					</label>

					<?php
					$args = array(
						'id'                          => 'language-switcher-locales',
						'name'                        => 'wp_lang',
						'selected'                    => determine_locale(),
						'show_available_translations' => false,
						'explicit_option_en_us'       => true,
						'languages'                   => $languages,
					);

					/**
					 * Filters default arguments for the Languages select input on the login screen.
					 *
					 * @since 5.9.0
					 *
					 * @param array $args Arguments for the Languages select input on the login screen.
					 */
					wp_dropdown_languages( apply_filters( 'login_language_dropdown_args', $args ) );
					?>

					<?php if ( $interim_login ) { ?>
						<input type="hidden" name="interim-login" value="1" />
					<?php } ?>

					<?php if ( isset( $_GET['redirect_to'] ) && '' !== $_GET['redirect_to'] ) { ?>
						<input type="hidden" name="redirect_to" value="<?php echo esc_url_raw( $_GET['redirect_to'] ); ?>" />
					<?php } ?>

					<?php if ( isset( $_GET['action'] ) && '' !== $_GET['action'] ) { ?>
						<input type="hidden" name="action" value="<?php echo esc_attr( $_GET['action'] ); ?>" />
					<?php } ?>

						<input type="submit" class="button" value="<?php esc_attr_e( 'Change' ); ?>">

					</form>
				</div>
		<?php } ?>
	<?php } ?>
	<?php

	if ( ! empty( $input_id ) ) {
		?>
		<script type="text/javascript">
		try{document.getElementById('<?php echo $input_id; ?>').focus();}catch(e){}
		if(typeof wpOnload==='function')wpOnload();
		</script>
		<?php
	}

	/**
	 * Fires in the login page footer.
	 *
	 * @since 3.1.0
	 */
	do_action( 'login_footer' );

	?>
	<div class="clear"></div>
	</body>
	</html>
	<?php
}

Expand full source code Collapse full source code View on Trac View on GitHub


Top ↑

Related

Top ↑

Uses

Uses
Uses Description
wp-login.php: login_display_language_dropdown

Filters the Languages select input activation on the login screen.

wp-login.php: login_language_dropdown_args

Filters default arguments for the Languages select input on the login screen.

wp-login.php: login_site_html_link

Filter the “Go to site” link displayed in the login page footer.

wp-includes/l10n.php: determine_locale()

Determine the current locale desired for the request.

wp-includes/link-template.php: the_privacy_policy_link()

Displays the privacy policy link with formatting, when applicable.

wp-includes/l10n.php: wp_dropdown_languages()

Language selector.

wp-login.php: login_footer

Fires in the login page footer.

wp-includes/l10n.php: get_available_languages()

Get all available languages based on the presence of *.mo files in a given directory.

wp-includes/l10n.php: _x()

Retrieve translated string with gettext context.

wp-includes/l10n.php: _e()

Display translated text.

wp-includes/l10n.php: esc_attr_e()

Display translated text that has been escaped for safe use in an attribute.

wp-includes/formatting.php: esc_url()

Checks and cleans a URL.

wp-includes/formatting.php: esc_url_raw()

Performs esc_url() for database or redirect usage.

wp-includes/formatting.php: esc_attr()

Escaping for HTML attributes.

wp-includes/general-template.php: get_bloginfo()

Retrieves information about the current site.

wp-includes/link-template.php: home_url()

Retrieves the URL for the current site where the front end is accessible.

wp-includes/plugin.php: apply_filters()

Calls the callback functions that have been added to a filter hook.

wp-includes/plugin.php: do_action()

Calls the callback functions that have been added to an action hook.

Show 13 more uses Hide more uses

Top ↑

Changelog

Changelog
Version Description
3.1.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.

  • About
  • News
  • Hosting
  • Donate
  • Support
  • Developers
  • Get Involved
  • Learn
  • Showcase
  • Plugins
  • Themes
  • Patterns
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
WordPress.org
WordPress.org
  • Visit our Facebook page
  • Visit our Twitter account
Code is Poetry

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.