$action is a variable that is set on line 384 of wp-login.php (as of WordPress 4.7.3).
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
When WordPress gets to line 428, it evaluates the string inside the double quotations first as
login_form_login if the
$_REQUEST['action'] variable is not set. If that variable is set, for instance as
register, then the string inside the double quotations would be evaluated as
When the the WordPress function
do_action() is interpreted, see line 421 of wp-includes/plugin.php, does some stuff, and on line 453 applies the
do_action() method of the
To see what this method does, we need to go to line 321 of wp-includes/class-wp-hook.php, which because hooks are just simplified filters, calls the
apply_filters() method, which is on line 276 of the same file.
The relevant parts of this method are lines 296, 298, and 300 and they look like:
$value = call_user_func_array( $the_['function'], array() );
call_user_func_array() is a PHP function that calls a callback with an array of parameters.
WordPress stores the callbacks for each hook in the
$wp_filter global. We add them using the
add_action( 'login_form_login', array( $this, 'redirect_to_custom_login' ));
This is telling WordPress to add an action to the
login_form_login hook and the callable callback is the
redirect_to_custom_login method from