Use the action 'login_init'
to catch all calls to wp-login.php
.
Sample code:
add_action( 'login_init', 'wpse_51227_validate_custom_field' );
function wpse_51227_validate_custom_field()
{
if ( ! isset ( $_POST['special_custom'] )
return;
if ( ! is_numeric( $_POST['special_custom'] )
// handle the error
}
There are two important global variables available:
$errors
is an instance ofWP_Error
. Maybe you want to use it to store error data.$action
is the current action. Maybe you want to rest it tologin
to prevent a redirect if the user input is invalid.
Related Posts:
- wp_login_form() ignoring login_form action hook
- Checking url from plugin [duplicate]
- How can I see all the actions attached to an “add_action” hook?
- How to include code only on specific pages?
- Schedule WordPress Auto-Updates to only run during business hours
- Remove action from plugin on other plugin
- How To Determine If A Filter Is Called In A Sidebar/Widget Context?
- Is there any debug toolbar that shows whick hooks are called for the current page in WordPress?
- When can you get current page ID and initialize hooks right after?
- Filter out results from REST API
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Filter Hook on plugin update
- WordPress Hook that will run when media file deleted
- Disallow a user to post in certain categories
- Intercepting a add_action
- Generic plugin (de)activation hook?
- How to get user-meta from Social Login registered users?
- Auto login using Active Directory and Windows Authentication
- How can I make content disappear when a user logs in?
- Tracking last login and last visit
- login to wordpress with Get variables instead of Post
- disable active plugins for specific theme
- Twillio How To Send SMS for Custom Post Type
- Find out if request is for custom post type archive before query runs
- Failed to invoke other hook from the init hook
- wordpress custom login successful redirect hook
- Is it possible to remove this action? (as it’s added just before it’s called)
- Determine plugin name from within plugin_action_links filter
- Placement of Code in Plugin for hooking `save_post`
- wp_authenticate but not logged in
- How to initialize something in unit test before the init hook being called?
- ‘wp_login’ action hook not working with wp-login.php file
- Cannot login to ADMIN even after changing password in phpmyadmin
- How do i login when i cant access wp-login.php?
- Where (or when) should I register a new taxonomy?
- Hook (or other way) to find out when another plugin is activated / installed
- Any hook for pre-plugin-update -either bulk or single plugin update
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- How to save generated JWT token to cookies on login?
- wp_get_post_terms is difference obj model than the one in rest api response
- Contributive page where people logged in can write
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- password_reset hook is not working
- Login cookies set as wrong domain
- edit_user_profile and show_user_profile are not firing inside a class
- Template filter for custom taxonomy terms
- Login Customizer doesn’t change the background of the register form
- What exactly happens to function argument availability when using a filter?
- Combining several CSS files into one for optimization
- Create a post builder skin in a plugin
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Login problem after installing my written plugin [closed]
- Can my hooked uninstall class function access a global var declared in main plugin file?
- Flipping Book PHP Code? Any experience?
- Hook for page Request?
- How to remove js ui library added by default by wordpress
- How to use the pre_option filter before a plugin loads?
- How to remove a class function from a plugin by using remove_action()?
- how do i change my website facebook login button to another text immediately user login? [closed]
- profile_update hook doesn’t works inside a class
- Plugin: Hooking up classes that have their own hooks
- Hook for altering the content of all wp mails
- Custom PHP Page Using WordPress login
- What hook can I use to modify custom post data before it is displayed on the page?
- How to Use the Filter “sidebar_login_widget_form_args”
- Quick press publish post hook
- If I use an alternative login (e.g. CAS or other SSO) plugin, is my site protected from the recent brute force login attempts?
- How to deactivate my plugin upon deactivation of NextGen
- Creating a plugin that will display text on every page
- Why does “updated_post_meta” did not fire when uploading media other than image?
- Build a must-use plugin that tracks when other plugins are activated or deactivated
- Change Dashboard URL from wp-admin to wp-admin/index.php
- Activation flow of a plugin in a multisite environment
- force logged in user to stay in the dashboard
- Callback hooked to post_updated firing on new posts as well
- Discern a specific plugin’s action hooks
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- Replace plugin HTML to single text using hooks
- How can I disable W3 Total Cache Image Lazy Load for Specific Post Type?
- https rewrite not working for All in one security Brute force > rename login url
- Customize plugin templates
- wordpress plugin translation not working
- Hook on widget context plugin to add custom context for widget
- wp_signon returns user, in popup window, but the user is not logged in
- Admin page and admin menu. Permissions plugin
- How should I use a plugin function as a hook?
- AJAX login without a plugin does not work. when add a action to function.php
- change output location of plugin function using a custom hook
- Plugin constructor called multiple times
- How to change value of $menu_class in ep_nav_menu?
- How to create and use Custom hooks
- Change All Login/Signup Links in Plugin
- How to display a link in the footer section
- How to Find WordPress site has backdoor login Codes
- How to Add Extra Text In WordPress Title Before Post Publish
- Why is my activator class adding the files/running the actions I add?
- Admin Notice is only localized when displaying the “Plugins” Backend Page