login_header( string|null $title = null, string $message = '', WP_Error|null $wp_error = null )
- Since
- 2.1.0
- Source
wp-login.php:41
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
- Scaling
- Scales with input
- Instructions
- 176–247
- Plugin surface
- 12 hooks
- Called by
- 0
Reads stored settings via get_option(), cached per request but not free on a cold cache.
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 308.
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.
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_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.
| When | Instructions | Calls it makes |
|---|---|---|
$title !== null && is_wp_error() && !wp_is_recovery_mode() && !empty($login_header_title) && empty($error) && !->has_errors() | 176–192 | add_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–196 | add_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–197 | add_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–201 | add_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–203 | add_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–203 | add_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–207 | add_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–208 | add_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–200 | add_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–208 | add_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–222 | add_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–212 | add_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–205 | add_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–214 | add_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–226 | add_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–227 | add_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–211 | add_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–219 | add_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–231 | add_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–233 | add_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–215 | add_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–230 | add_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–238 | add_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–231 | add_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–233 | add_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–235 | add_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–236 | add_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–240 | add_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–242 | add_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–239 | add_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–247 | add_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–242 | add_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
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 307 | 176–247 | 26 | 1 fewer instruction than PHP 8.5 |
| 8.5 | 308 | 176–247 | 26 | |
| 8.4 | 308 | 176–247 | 26 | 9 fewer instructions than PHP 8.3 |
| 8.3 | 317 | 182–253 | 26 | |
| 8.2 | 317 | 182–253 | 26 | |
| 8.1 | 317 | 182–253 | 26 | |
| 7.4 | 317 | 182–253 | 26 |
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:
- apply_filters( shake_error_codes )filterline 67 (+26 into the body)
Filters the error codes array for shaking the login form.
- apply_filters( login_title )filterline 91 (+50 into the body)
Filters the title tag content for login page.
- do_action( login_enqueue_scripts )actionline 120 (+79 into the body)
Enqueues scripts and styles for the login page.
- do_action( login_head )actionline 127 (+86 into the body)
Fires in the login page header after scripts are enqueued.
- apply_filters( login_headerurl )filterline 138 (+97 into the body)
Filters link URL of the header logo above login form.
- do_action( login_headertitle )filter_deprecatedline 150 (+109 into the body)
Filters the title attribute of the header logo above login form.
- apply_filters( login_headertext )filterline 167 (+126 into the body)
Filters the link text of the header logo above the login form.
- apply_filters( login_body_class )filterline 197 (+156 into the body)
Filters the login page body classes.
- do_action( login_header )actionline 212 (+171 into the body)
Fires in the login page header after the body tag is opened.
- apply_filters( login_message )filterline 231 (+190 into the body)
Filters the message to display above the login form.
- apply_filters( login_errors )filterline 280 (+239 into the body)
Filters the error messages displayed above the login form.
- apply_filters( login_messages )filterline 300 (+259 into the body)
Filters instructional messages displayed above the login form.
Uses · 21
- __()Retrieves the translation of $text.
- add_filter()Adds a callback function to a filter hook.
- add_action()Adds a callback function to an action hook.
- is_wp_error()Checks whether the given variable is a WordPress Error.
- apply_filters()Calls the callback functions that have been added to a filter hook.
- get_bloginfo()Retrieves information about the current site.
- wp_is_recovery_mode()Determines whether WordPress is in Recovery Mode.
- language_attributes()Displays the language attributes for the 'html' tag.
- bloginfo()Displays information about the current site.
- wp_enqueue_style()Enqueues a CSS stylesheet.
- wp_print_inline_script_tag()Prints an inline script tag.
- wp_remove_surrounding_empty_script_tags()Removes leading and trailing _empty_ script tags.
Show all 21
- do_action()Calls the callback functions that have been added to an action hook.
- apply_filters_deprecated()Fires functions attached to a deprecated filter hook.
- is_rtl()Determines whether the current locale is right-to-left (RTL).
- sanitize_html_class()Sanitizes an HTML classname to ensure it only contains valid characters.
- get_locale()Retrieves the current locale.
- esc_attr()Escaping for HTML attributes.
- esc_url()Checks and cleans a URL.
- wp_admin_notice()Outputs an admin notice.
- WP_Error::__construct()Initializes the error.
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 ‹ %2$s — WordPress' ), $title, $login_title ); if ( wp_is_recovery_mode() ) { /* translators: %s: Login screen title. */ $login_title = sprintf( __( 'Recovery Mode — %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.
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.