Action hook 'login_form_{$action}'

in WP Core File wp-login.php at line 571

View Source

login_form_{$action}

Action Hook
Description
Fires before a specified login form action. The dynamic portion of the hook name, `$action`, refers to the action that brought the visitor to the login form. Possible hook names include: - `login_form_checkemail` - `login_form_confirm_admin_email` - `login_form_confirmaction` - `login_form_entered_recovery_mode` - `login_form_login` - `login_form_logout` - `login_form_lostpassword` - `login_form_postpass` - `login_form_register` - `login_form_resetpass` - `login_form_retrievepassword` - `login_form_rp`

Hook Information

File Location wp-login.php View on GitHub
Hook Type Action
Line Number 571

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into login_form_{$action}
add_action('login_form_{$action}', 'my_custom_function');

function my_custom_function() {
    // Your custom code here
}

Source Code Context

wp-login.php:571 - How this hook is used in WordPress core
<?php
 566   *  - `login_form_retrievepassword`
 567   *  - `login_form_rp`
 568   *
 569   * @since 2.8.0
 570   */
 571  do_action( "login_form_{$action}" );
 572  
 573  $http_post     = ( 'POST' === $_SERVER['REQUEST_METHOD'] );
 574  $interim_login = isset( $_REQUEST['interim-login'] );
 575  
 576  /**

PHP Documentation

<?php
/**
 * Fires before a specified login form action.
 *
 * The dynamic portion of the hook name, `$action`, refers to the action
 * that brought the visitor to the login form.
 *
 * Possible hook names include:
 *
 *  - `login_form_checkemail`
 *  - `login_form_confirm_admin_email`
 *  - `login_form_confirmaction`
 *  - `login_form_entered_recovery_mode`
 *  - `login_form_login`
 *  - `login_form_logout`
 *  - `login_form_lostpassword`
 *  - `login_form_postpass`
 *  - `login_form_register`
 *  - `login_form_resetpass`
 *  - `login_form_retrievepassword`
 *  - `login_form_rp`
 *
 * @since 2.8.0
 */
Quick Info
  • Hook Type: Action
  • Parameters: 0
  • File: wp-login.php
Related Hooks

Related hooks will be displayed here in future updates.