This is a dynamic hook:
do_action( "login_form_{$action}" );
Meaning that it depends on the $action
variable.
There are other such hooks used in the WordPress core.
You can check out the naming convention for dynamic hooks in the Core Contributor Handbook here. It’s says e.g.:
Dynamic hooks should be named using interpolation rather than
concatenation for readability and discoverability purposes.
Double quoted strings in PHP can parse variables, that’s why it’s not written with single quotes:
do_action( 'login_form_{$action}' );
Check out the curly syntax in the PHP docs in the variable parsing section.
Example:
If we have:
$action = 'login';
then it will generate the following action:
do_action( "login_form_login" );
that plugins can hook into via:
add_action( 'login_form_login', ... );
Related Posts:
- Difference Between Filter and Action Hooks?
- Which hook should be used to add an action containing a redirect?
- How do you use the plugin boilerplate loader class to hook actions and filters?
- How Do I Load My Action Earlier Enough?
- Does WP fire delete_post when trashed posts are automatically deleted?
- What’s the earliest point I can get the queried object ID?
- How do I Make a Theme “plugin-ready”?
- What’s the difference between hooks, filters and actions? [duplicate]
- How to use filter hook ‘post_updated_messages’ in coherence with action hook ‘save_post’
- Is it possible to create an action hook using do_action() within add_action()?
- How can I hook into existing WordPress Bulk actions?
- Define a function outside a class and call the function using action or filter hook
- Create a plugin to change the action to which a function is hooked
- Modifying values with add_action to be sent to db
- Woocommerce – Hide a Column in Cart Table
- Hook to get image filename when it is uploaded
- Which are the hooks run before/after when a category’s deletion?
- Should action callbacks start with a verb?
- Execute Hook on the footer or header after activating a plugin
- Namespaced action and filter tags
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- I have 2 plugins using the same wp_login action hook and one is not working
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- How to get all queries’s results after they have executed?
- Bug: Post needs to be updated twice when adding action for save_post hook
- When does save_post hook fire on post save/update
- Hook add_attachment error
- Call to undefined function is_home() or any conditional tags
- How to find list of all functions bind to a particular hook from my plugin?
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- Using init hook for register_taxonomy is causing invalid_taxonomy in wp_insert_term()
- Action / Hook when a new plugin is added
- apply_filters() and call_user_func() to define and call a function outside a class
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- remove different admin menu for specific users
- add_option_{$option} action hook not being called
- Does WordPress have something like timer hook?
- How can I set a dynamic value for post_updated_messages based on return value of post_updated?
- Insert plugin html content to a specific spot in the frontpage
- Apply function on all action hooks?
- Ninja Forms: Front-End Forms, Post ID?
- WordPress Update Plugin Hook/Action? Since 3.9
- Add a new tab to WordPress Plugin install Listing
- Changing Plugin Load Order
- How should you hook a session_start() when authoring a plugin?
- When can you get current page ID and initialize hooks right after?
- Init action hook running late after PayPal’s return url?
- Do I need to call do_action in my plugin?
- Which to use to execute code during the saving of a plugin settings page?
- Using the ‘draft_to_publish’ hook (post status transition)
- I can’t find where a hook is being defined in a plugin – Easy Digital Downloads
- How do I handle multiple Submit buttons in plugin’s option page?
- Hook for post permalink update
- Dynamically Override Fancy Title
- Adding Automatically To In WordPress Using Filter Referencing?
- comment_email hook doesn’t seem to work for comment editor field
- Add tab to profile.php wordpress plugin development
- admin_notices not displaying in plugin
- How do I change the initial quantity of a product in woocommerce?
- Where and how does WordPress store and use its plugin and hook information?
- Getting admin notices working for plugin errors
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- edit_{$taxonomy} | Hook
- WordPress after content Hook & external template part
- An echo line in a transition_post_status action leads to “cannot modify header information – headers already sent by”
- Where to add hooks in a class
- How to use output buffering in WordPress hooked functions?
- Adding option to Gallery shortcode
- Plugin with action ‘save_post’ needs to press publish twice on order to publish
- Adding rewrite rule dynamically
- do_action and add_action on two different installed plugins won’t work
- Adding widgets to my plugin page instead of WordPress dashboard
- Add a new confirmation page before saving
- WordPress class, using add_action to call member function does not work
- Where do I put my add_action(… and add_filter(… and do I need to remove them?
- Does admin_print_scripts-$hook_suffix work for nested paths to individual files?
- Delete data from database using row action
- Plugin does not add action
- How to replace default comments with custom HTML?
- Is there an admin hook that will let me read GET variable before it’s too late to set the header Location
- Hook for page Request?
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- Add a check box in Menu Settings
- Hide one specific woocoomerce product
- Include HTML (Bootstrap Modal Box) with a plugin into my header
- Set the payment processor callbacks to a plugin
- Trigger function on Remove block or add new block in Gutenberg JavaScript
- Woocommerce get_term_by() in transition_post_status hook doesn’t works
- Add two button to page and post admin to redirect to : add new & list of (posts – pages) just after saving post or page
- Limit get_next_post to posts from the same author
- Where do I hook to have the server do something in PHP on block attribute change?
- Any way, hook to add content right before the “read more” link?
- Add a custom submenu under submenu in a Custom WordPress Plugin
- Post is uncatagorized in publish_post action
- How do I ensure I can loop through every enqueued script and CSS?
- replacing jquery google cdn with a new version dynamically
- Unable to show a message after plugin activation
- how to insert content into wp_head after loop_end
- Trigger a JavaScript function based on the data fetched from Woo commerce hook