Integrating WordPress to my website, while keeping my own authentication system

WordPress’s authentication system is made up of pluggable functions, which means that you can write a plugin that has a function named, say, wp_authenticate(), and your site will use your wp_authenticate() function instead of the native WordPress one.

Your comment about is_user_logged_in() (on your original post) is obviated by the fact that is_user_logged_in() calls the pluggable wp_get_current_user(), meaning that you can write your own wp_get_current_user() and control is_user_logged_in() that way.

So you should be able to write an authentication system for WordPress that will use your pre-existing user database.

References

Leave a Comment