login_footer( string $input_id = '' )
- Since
- 3.1.0
- Source
wp-login.php:325
Compatibility
- WordPress
- since 3.1.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$input_idstringoptional- Which input to auto-focus.Default:
''
Performance profile
How much work a call to login_footer() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Moderate
- Scaling
- Constant
- Instructions
- 13–134
- Plugin surface
- 4 hooks
- Called by
- 0
Reads stored settings via get_option(), cached per request but not free on a cold cache.
No loop in the body: the same number of instructions runs whatever you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 134.
Third-party callbacks on 'login_site_html_link', 'login_display_language_dropdown', 'login_language_dropdown_args' run inside this call, and their cost is not bounded by anything here.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- hookthird-party callbacks
apply_filters()called directly - optionoption read or write
get_option()one call below login_footer()
Further down the call graph this can also reach cache, serialize, query, transient and http. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.
What one call costs · 28 distinct outcomes
One number would be a lie: the work depends on which branch runs. These are every distinct cost login_footer() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
empty($input_id) | 13 | do_action() |
!apply_filters() && empty($input_id) | 18 | apply_filters(), do_action() |
apply_filters() && empty($languages) && empty($input_id) | 24 | apply_filters(), get_available_languages(), do_action() |
!empty($input_id) | 26 | ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
!apply_filters() && !empty($input_id) | 31 | apply_filters(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && empty($languages) && !empty($input_id) | 37 | apply_filters(), get_available_languages(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
empty($input_id) | 47 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), do_action() |
!apply_filters() && empty($input_id) | 52 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), do_action() |
apply_filters() && empty($languages) && empty($input_id) | 58 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), do_action() |
apply_filters() && !empty($languages) && empty($input_id) | 60–69 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr_e(), do_action() |
!empty($input_id) | 60 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
!apply_filters() && !empty($input_id) | 65 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
16 further outcomes, up to 134 instructions
apply_filters() && empty($languages) && !empty($input_id) | 71 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && empty($input_id) | 73–78 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && isset($value) && empty($input_id) | 73–78 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && !empty($input_id) | 73–82 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && empty($input_id) | 86–87 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && isset($value) && !empty($input_id) | 86–91 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && !empty($input_id) | 86–91 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && empty($input_id) | 94–103 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && isset($value) && !empty($input_id) | 99–100 | apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && empty($input_id) | 107–112 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && isset($value) && empty($input_id) | 107–112 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && !empty($input_id) | 107–116 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && empty($input_id) | 120–121 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr(), esc_attr_e(), do_action() |
apply_filters() && !empty($languages) && isset($value) && !empty($input_id) | 120–125 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), esc_attr(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && !empty($input_id) | 120–125 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
apply_filters() && !empty($languages) && isset($value) && !empty($input_id) | 133–134 | home_url(), esc_url(), _x(), get_bloginfo(), sprintf(), apply_filters(), the_privacy_policy_link(), apply_filters(), get_available_languages(), _e(), determine_locale(), apply_filters(), wp_dropdown_languages(), sanitize_url(), esc_attr(), esc_attr_e(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 134 | 13–134 | 10 | |
| 8.5 | 134 | 13–134 | 10 | |
| 8.4 | 134 | 13–134 | 10 | 1 fewer instruction than PHP 8.3 |
| 8.3 | 135 | 13–135 | 10 | |
| 8.2 | 135 | 13–135 | 10 | |
| 8.1 | 135 | 13–135 | 10 | |
| 7.4 | 135 | 13–135 | 10 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Hooks and filters fired · 4
4 hooks fire while login_footer() runs, in this order:
- apply_filters( login_site_html_link )filterline 349 (+24 into the body)
Filters the "Go to site" link displayed in the login page footer.
- apply_filters( login_display_language_dropdown )filterline 370 (+45 into the body)
Filters whether to display the Language selector on the login screen.
- apply_filters( login_language_dropdown_args )filterline 402 (+77 into the body)
Filters default arguments for the Language select input on the login screen.
Uses · 16
- esc_url()Checks and cleans a URL.
- home_url()Retrieves the URL for the current site where the front end is accessible.
- _x()Retrieves translated string with gettext context.
- get_bloginfo()Retrieves information about the current site.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- the_privacy_policy_link()Displays the privacy policy link with formatting, when applicable.
- get_available_languages()Gets all available languages based on the presence of *.mo and *.l10n.php files in a given directory.
- _e()Displays translated text.
- determine_locale()Determines the current locale desired for the request.
- wp_dropdown_languages()Displays or returns a Language selector.
- sanitize_url()Sanitizes a URL for database or redirect usage.
- esc_attr()Escaping for HTML attributes.
Show all 16
- esc_attr_e()Displays translated text that has been escaped for safe use in an attribute.
- wp_print_inline_script_tag()Prints an inline script tag.
- wp_remove_surrounding_empty_script_tags()Removes leading and trailing _empty_ script tags.
- do_action()Calls the callback functions that have been added to an action hook.
Source code
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( '← Go to %s', 'site' ), get_bloginfo( 'title', 'display' ) ) ); /** * Filters 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 whether to display the Language selector on the login screen. * * @since 5.9.0 * * @param bool $display Whether to display the Language selector 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" method="get"> <label for="language-switcher-locales"> <?php _e( 'Language' ); ?><span class="dashicons dashicons-translation" aria-hidden="true"></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 Language select input on the login screen. * * The arguments get passed to the wp_dropdown_languages() function. * * @since 5.9.0 * * @param array $args Arguments for the Language select input on the login screen. */ wp_dropdown_languages( apply_filters( 'login_language_dropdown_args', $args ) ); ?> Changelog
Introduced in 3.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-login.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.