wppaste
WordPress

login_header( string|null $title = null, string $message = '', WP_Error|null $wp_error = null )

Since
2.1.0
Source
wp-login.php:41
Outputs the login page header.

Compatibility

WordPress
since 2.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

$titlestring|nulloptional
WordPress login page title to display in the <title> element.
Defaults to 'Log In'.Default: null
$messagestringoptional
Message to display in header. Default empty.Default: ''
$wp_errorWP_Error|nulloptional
The error to pass. Defaults to a WP_Error instance.Default: null

Performance profile

How much work a call to login_header() 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
Heavy

Reads stored settings via get_option(), cached per request but not free on a cold cache.

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
176–247

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 308.

Plugin surface
12 hooks

Third-party callbacks on 'shake_error_codes', 'login_title', 'login_enqueue_scripts' run inside this call, and their cost is not bounded by anything here.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • hookthird-party callbacksapply_filters()called directly
  • optionoption read or writeget_option()one call below login_header()

Further down the call graph this can also reach cache, serialize, query and transient. Those are the worst case, several calls deep and usually down an error path, not what a normal call pays.

What one call costs · 32 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost login_header() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && !->has_errors()176–192add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && empty($error) && !->has_errors()180–196add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && !->has_errors()181–197add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !empty($error) && !->has_errors()185–201add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && ->has_errors() && empty($error_list) && empty($messages)186–203add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && !->has_errors()187–203add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && empty($error) && ->has_errors() && empty($error_list) && empty($messages)190–207add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && ->has_errors() && empty($error_list) && empty($messages)191–208add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && empty($error) && !->has_errors()191–200add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && !->has_errors()192–208add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && ->has_errors()195–222add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !empty($error) && ->has_errors() && empty($error_list) && empty($messages)195–212add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes()
20 further outcomes, up to 242 instructions
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && !empty($error) && !->has_errors()196–205add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && ->has_errors() && empty($error_list) && empty($messages)197–214add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && empty($error) && ->has_errors()199–226add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && ->has_errors()200–227add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && empty($error) && ->has_errors() && empty($error_list) && empty($messages)201–211add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && ->has_errors() && empty($error_list) && empty($messages)202–219add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !empty($error) && ->has_errors()204–231add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && ->has_errors()206–233add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && !empty($error) && ->has_errors() && empty($error_list) && empty($messages)206–215add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && empty($error) && ->has_errors()210–230add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && ->has_errors()211–238add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)212–231add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && !empty($error) && ->has_errors()215–233add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)216–235add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)217–236add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)221–240add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)223–242add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)227–239add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && !empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)228–247add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()
$title !== null && is_wp_error() && !wp_is_recovery_mode() && empty($login_header_title) && !is_rtl() && !empty($error) && ->has_errors() && !empty($error_list) && !empty($messages)232–242add_filter(), add_action(), add_action(), is_wp_error(), apply_filters(), get_bloginfo(), __(), sprintf(), wp_is_recovery_mode(), apply_filters(), language_attributes(), bloginfo(), bloginfo(), wp_enqueue_style(), ->get_error_code(), ob_start(), ob_get_clean(), wp_remove_surrounding_empty_script_tags(), wp_print_inline_script_tag(), do_action(), do_action(), __(), apply_filters(), __(), apply_filters_deprecated(), __(), apply_filters(), is_rtl(), get_locale(), strtolower(), sanitize_html_class(), apply_filters(), esc_attr(), wp_print_inline_script_tag(), do_action(), esc_url(), apply_filters(), ->add(), ->has_errors(), ->get_error_codes(), apply_filters(), wp_admin_notice(), apply_filters(), wp_admin_notice()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev307176–247261 fewer instruction than PHP 8.5
8.5308176–24726
8.4308176–247269 fewer instructions than PHP 8.3
8.3317182–25326
8.2317182–25326
8.1317182–25326
7.4317182–25326

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 · 12

12 hooks fire while login_header() runs, in this order:

  1. apply_filters( shake_error_codes )filterline 67 (+26 into the body)

    Filters the error codes array for shaking the login form.

  2. apply_filters( login_title )filterline 91 (+50 into the body)

    Filters the title tag content for login page.

  3. do_action( login_enqueue_scripts )actionline 120 (+79 into the body)

    Enqueues scripts and styles for the login page.

  4. do_action( login_head )actionline 127 (+86 into the body)

    Fires in the login page header after scripts are enqueued.

  5. apply_filters( login_headerurl )filterline 138 (+97 into the body)

    Filters link URL of the header logo above login form.

  6. do_action( login_headertitle )filter_deprecatedline 150 (+109 into the body)

    Filters the title attribute of the header logo above login form.

  7. apply_filters( login_headertext )filterline 167 (+126 into the body)

    Filters the link text of the header logo above the login form.

  8. apply_filters( login_body_class )filterline 197 (+156 into the body)

    Filters the login page body classes.

  9. do_action( login_header )actionline 212 (+171 into the body)

    Fires in the login page header after the body tag is opened.

  10. apply_filters( login_message )filterline 231 (+190 into the body)

    Filters the message to display above the login form.

  11. apply_filters( login_errors )filterline 280 (+239 into the body)

    Filters the error messages displayed above the login form.

  12. apply_filters( login_messages )filterline 300 (+259 into the body)

    Filters instructional messages displayed above the login form.

Uses · 21

Show all 21

Source code

function login_header( $title = null, $message = '', $wp_error = null ) {	global $error, $interim_login, $action; 	if ( null === $title ) {		$title = __( 'Log In' );	} 	// Don't index any of these forms.	add_filter( 'wp_robots', 'wp_robots_sensitive_page' );	add_action( 'login_head', 'wp_strict_cross_origin_referrer' ); 	add_action( 'login_head', 'wp_login_viewport_meta' ); 	if ( ! is_wp_error( $wp_error ) ) {		$wp_error = new WP_Error();	} 	// Shake it!	$shake_error_codes = array( 'empty_password', 'empty_email', 'invalid_email', 'invalidcombo', 'empty_username', 'invalid_username', 'incorrect_password', 'retrieve_password_email_failure' );	/**	 * Filters the error codes array for shaking the login form.	 *	 * @since 3.0.0	 *	 * @param string[] $shake_error_codes Error codes that shake the login form.	 */	$shake_error_codes = apply_filters( 'shake_error_codes', $shake_error_codes ); 	if ( $shake_error_codes && $wp_error->has_errors() && in_array( $wp_error->get_error_code(), $shake_error_codes, true ) ) {		add_action( 'login_footer', 'wp_shake_js', 12 );	} 	$login_title = get_bloginfo( 'name', 'display' ); 	/* translators: Login screen title. 1: Login screen name, 2: Network or site name. */	$login_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, $login_title ); 	if ( wp_is_recovery_mode() ) {		/* translators: %s: Login screen title. */		$login_title = sprintf( __( 'Recovery Mode &#8212; %s' ), $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>	<html <?php language_attributes(); ?>>	<head>	<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />	<title><?php echo $login_title; ?></title>	<?php 	wp_enqueue_style( 'login' ); 	/*	 * Remove all stored post data on logging out.	 * This could be added by add_action('login_head'...) like wp_shake_js(),	 * but maybe better if it's not removable by plugins.	 */	if ( 'loggedout' === $wp_error->get_error_code() ) {		ob_start();		?>		<script>if("sessionStorage" in window){try{for(var key in sessionStorage){if(key.indexOf("wp-autosave-")!=-1){sessionStorage.removeItem(key)}}}catch(e){}};</script>		<?php		wp_print_inline_script_tag( wp_remove_surrounding_empty_script_tags( ob_get_clean() ) );	} 	/**	 * Enqueues scripts and styles for the login page.	 *	 * @since 3.1.0	 */	do_action( 'login_enqueue_scripts' );

Changelog

Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 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.