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:
$errorsis an instance ofWP_Error. Maybe you want to use it to store error data.$actionis the current action. Maybe you want to rest it tologinto 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?
- 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?
- 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
- 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
- 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?
- 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
- How to use login_redirect with a user capability
- easy steps to make front end form without plugin
- Why do plugins often ask to add in to templates?
- remove_action not removing add_action from constructor
- How to get menu location in wp_update_nav_menu hook
- Flipping Book PHP Code? Any experience?
- Too many login attempts
- Display Plugin Panels Outside of Admin Areas
- How to use template_include hook with form submission?
- Save user total active time after login in wordpress [closed]
- Advanced WordPress plugin activation detection
- wp_loaded with static Singleton
- How to return the values from a row where a value occurs for the first time among the rows available?
- is it possible to hook every page style?
- How to Use the Filter “sidebar_login_widget_form_args”
- How to hook into action/filter call
- Manage PDF downloads and protected pages
- login in wordpress using gmail account
- How can I replace content on site generated from plugin without changing plugin
- How to automatically activate users after registration without activation email?
- Hooks to run after a core upgrade?
- Adding custom Field To The Posts Listing
- Add hook after content without formatting
- Using Remove Action Hook in Plugin
- admin_post hook not firing function inside class
- Alternative Hook to the_content for Changing Background Color
- Share login credential with QR code
- Display Woocommerce attribute name above product title
- How can I show login popup when user clicks on download button
- When the user entered an unauthorized url redirect to login page
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- What is the correct entry point for capturing coverage data
- using wordpress login details for other website / application / forum?
- How to Create Custom Dashboard for my Laundry Website?
- Add a filter to a method in the parent theme
- Publish check if the edited content has HTML “div”
- User content database [closed]
- Run only on plug-in activation instead of wp_head
- Plugins effecting layout & login
- Redirect default login page to a custom page [duplicate]
- Display_rows() and column_cb() strange behaviour
- Transition Post status not working
- First argument is expected to be a valid callback for cp_admin_init and _canonical_charset
- HTTP Error 403 When Trying to Login
- What plugin(s) are best for this User registration task? [closed]
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Post curl function save twice using plugin hook function wordpress
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Hook automatic_updates_complete to autoupdate plugin
- Neither update_option nor delete_option fires in deactivation hook
- WordPress Homepage Login
- I cannot login after installing the wp-login timeout setting plugin
- Issue: Unable to Access WordPress Admin and Database Errors
- WordPress : how to create onglet and remove it when only one
- Custom Login and Password Reset for BuddyPress Website
- Lost Password of my site, how to reset wordpress password?
- Which approach for managing automatic updates would be more robust?