Add new action 'wp_authenticate_username_password_before'

This commit is contained in:
champsupertramp
2016-05-13 19:22:15 +08:00
parent b0231ceb87
commit 1b0da56411
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -286,3 +286,13 @@
echo $ultimatemember->fields->display( 'login', $args );
}
/**
* Remove authenticate filter
* @uses 'wp_authenticate_username_password_before'
*/
add_action('wp_authenticate_username_password_before','um_auth_username_password_before',10,3);
function um_auth_username_password_before( $user, $username, $password ){
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
}
+1 -1
View File
@@ -66,7 +66,7 @@
add_filter('authenticate', 'um_wp_form_errors_hook_logincheck', 999, 3);
function um_wp_form_errors_hook_logincheck( $user, $username, $password ) {
remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 );
do_action('wp_authenticate_username_password_before', $user, $username, $password );
if ( isset( $user->ID ) ) {