Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Creating an ‘authenticate’ filter

$
0
0

Replies: 0

What should the ‘authenticate’ filter(s) return for the login process to be aborted? Looking at the code on Trac, it looks like I can return an instance of WP_Error. But all I get when I do that is that the login process is successful and the user is logged in (correctly).

I setup the filter hook like so:

add_filter( 'authenticate', 'my_auth_check', 10, 3 );

And then in my_auth_check() return:

return( new WP_Error( 'invalid_username', 'The username is invalid' ) );

And this seems to have no effect whatsoever.


Viewing all articles
Browse latest Browse all 59525

Trending Articles