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]
- Passing a parameter to filter and action functions
- Get a list of all registered actions
- How can I edit post data before it is saved?
- How can I see all the actions attached to an “add_action” hook?
- Registering Class methods as hook callbacks
- How to customize woocommerce related products? [closed]
- How to include code only on specific pages?
- Changing the “Plugin Activated” Message Default
- wordpress plugin translation not working
- Why does WordPress use cookies for /wp-admin and /wp-content/plugins for non-admin users [duplicate]
- 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
- Identify if the_post hook is being called from the admin post list
- Hook on widget context plugin to add custom context for widget
- using wordpress login details for other website / application / forum?
- wp_signon returns user, in popup window, but the user is not logged in
- plugin not hooking to my custom hook
- How to Create Custom Dashboard for my Laundry Website?
- Why can’t I shove an instance of a class into a variable from a do_action hook?
- Add a filter to a method in the parent theme
- Publish check if the edited content has HTML “div”
- Creating Custom Hook for my plugin
- Admin page and admin menu. Permissions plugin
- User content database [closed]
- Passing a parameter to filter and action functions
- Run only on plug-in activation instead of wp_head
- WordPress hook source
- Auto-login from backend
- Modify a plugin’s content
- 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
- Plugins effecting layout & login
- Manually return false for function_exists
- How to `remove_action` from plugin
- Redirect default login page to a custom page [duplicate]
- wp-admin will not redirect to wp-login.php
- Plugin hook breaks new WP 4.0 media library grid view?
- Plugin Hook: Get posts
- Display_rows() and column_cb() strange behaviour
- Adding google authenticator and use only email address of user
- Transition Post status not working
- 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?
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- How to create and use Custom hooks
- First argument is expected to be a valid callback for cp_admin_init and _canonical_charset
- functions.php conditional output for a single plugin
- how to protect wordpress website
- Variable scope in plugin outside loop [closed]
- How to make plugin work in each template in wordpress
- WordPress ReAuth =1 Loop with wpCAS
- HTTP Error 403 When Trying to Login
- Advice on setting up private site
- OOP Plugin: Where should I place the action hooks in the class?
- What plugin(s) are best for this User registration task? [closed]
- Trouble Removing Plugin [closed]
- Change All Login/Signup Links in Plugin
- How do I to override login redirect on specific pages?
- How to display a link in the footer section
- 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
- plugin for different writers [closed]
- User register hook can’t access form request
- How to resolve these findings from security audit
- ERROR: Cookies are blocked due to unexpected output – no access to FTP
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- How to Find WordPress site has backdoor login Codes
- WordPress Hooks : Where to place callbacks that repetitively yield the same effect?
- How to create a custom wordpress plugin for a specific functionality?
- Hook automatic_updates_complete to autoupdate plugin
- How to Add Extra Text In WordPress Title Before Post Publish
- Can’t use updated variables in handle function
- Neither update_option nor delete_option fires in deactivation hook
- Suitable hook when creating, updating and deleting posts programmatically
- WordPress Homepage Login
- I cannot login after installing the wp-login timeout setting plugin
- Why is my activator class adding the files/running the actions I add?
- Change social icon in twenty twenty three theme
- is_user_logged_in() undefined at shutdown in plugin context
- Admin Notice is only localized when displaying the “Plugins” Backend Page
- Issue: Unable to Access WordPress Admin and Database Errors
- WordPress : how to create onglet and remove it when only one
- Customize WP Filter Hook
- Custom Login and Password Reset for BuddyPress Website
- Is there a plugin or resource for custom implementation for OAUTH and regular user login?
- How to create WordPress login for different users, with different roles?
- WordPress Action Hook inside Classes
- Add 2 links in between the navigation using the Breadcrumb Navxt plugin hook
- Remove H1 title in admin post edit screen
- What is this async request in wordpress
- Preview for revision?
- What is the best way to override functions of thirdparty plugins?
- I have to select text from gutenberg editor. Purpose is to store and replace text
- Remove 3rd party plugin notices from within own plugin
- Lost Password of my site, how to reset wordpress password?
- Similar hook to ‘init’ for when plugin page loads