• Hi

    I am trying to create an alternative wp_authenticate that sends info via XML-RPC if the user doesn’t exist. I’ve successfully made an alternate form that can do this, from an alternate file, but I’m running into a wall when trying to create a new IXR_Client from within the alternate wp_authenticate function.

    The function breaks after the line where I create a new IXR_Client. Any ideas why this might be happening?

    function wp_authenticate($username, $password) {
    	$username = sanitize_user($username);
    	$password = trim($password);
    
    	$user = apply_filters('authenticate', null, $username, $password);
    
    	if ( $user == null ) {
    		// TODO what should the error message be? (Or would these even happen?)
    		// Only needed if all authentication handlers fail to return anything.
    		$user = new WP_Error('authentication_failed', __('<strong>ERROR</strong>: Invalid username or incorrect password.'));
    	}
    
    	$ignore_codes = array('empty_username', 'empty_password');
    
    	if (is_wp_error($user) && !in_array($user->get_error_code(), $ignore_codes) ) {
    		do_action('wp_login_failed', $username);
    	}
    
    	if (is_wp_error($user)){
    			include_once(get_bloginfo().'/wp-includes/class-IXR.php');
    			$url = 'https://mydomain.com/');
    			$client = new IXR_Client($url);
    	}
    
    	return $user;
    }
  • The topic ‘New IXR_Client Breaking’ is closed to new replies.