Leave a Reply

2 comments

  1.     $username = $_POST['username'];
        $password = $_POST['password'];
    
        define('__ROOT__', dirname('public_html'));
        require_once (__ROOT__.'/blog/wp-load.php');
    
        $credentials = array('user_login' => $username, 'user_password' => $password);
        $user  = wp_signon($credentials,$secure_cookie);
    

    This is the code that I placed immediately after my site log-in was validated. What this basically does is include the wp-load.php file, which in turn allows me to make WP function calls from my site. So I call the wp_signon( ) function passing along the posted values from my site.

    Please note this method only works if the username and password of both the the site and WP blog are the same. This is not a proper method for WP Single Sign On, just a hack that worked in my case

    I had later disabled the option of changing the password on the admin panel.