login_header
Fires immediately after the opening <body> tag on the login/authorization page (wp-login.php), before the form is output.
See the similar login_footer hook, which fires after the form is output.
Usage
add_action( 'login_header', 'wp_kama_login_header_action' );
/**
* Function for `login_header` action-hook.
*
* @return void
*/
function wp_kama_login_header_action(){
// action...
}
Examples
#1 Add a custom block to the login page header
<?php
add_action( 'login_header', 'add_custom_block_to_login_header' );
function add_custom_block_to_login_header() {
?>
<div class="custom-block">
<p>Welcome to our site!</p>
</div>
<style>
.custom-block {
padding: 15px;
color: #ffffff;
text-align: center;
font-size: 20px;
background: #488902;
}
</style>
<?php
}
#2 Beautiful registration page — mountain landscape with a parallax effect
The code is published on github.com.
Changelog
| Since 4.6.0 | Introduced. |
Where the hook is called
login_header
wp-login.php 212
do_action( 'login_header' );
