Action login_form_{action} working

I found this action hook in wp-login.php file. It says it can be used to create custom actions to the wp-login. However, as I’m new to WP coding and PHP, I do not understand how {action} can work even though it is under double quotations? Here is the action hook:

do_action( "login_form_{$action}" );

In the plugin that I’m following, this action hook is added by this:

add_action( 'login_form_login', array( $this, 'redirect_to_custom_login' ));

How does login_form_login matches and replaces login_form_{action} ?

Read more here: Action login_form_{action} working

Leave a Reply

Your email address will not be published. Required fields are marked *