src/WordpressClient.php
function setCredentials($xmlrpcEndPoint, $username, $password)
    {
        // prepend http protocol to the end point if needed
        $scheme = parse_url($xmlrpcEndPoint, PHP_URL_SCHEME);
        if (!$scheme) {
            $xmlrpcEndPoint = "http://{$xmlrpcEndPoint}";
        }

        // swith to https when working with wordpress.com blogs
        $host = parse_url($xmlrpcEndPoint, PHP_URL_HOST);
        if (substr($host, -14) == '.wordpress.com') {
            $xmlrpcEndPoint = preg_replace('|http://|', 'https://', $xmlrpcEndPoint, 1);
        }

        // save information
        $this->endPoint = $xmlrpcEndPoint;
        $this->username = $username;
        $this->password = $password;
    }
function setCredentials($xmlrpcEndPoint, $username, $password)
    {
        // prepend http protocol to the end point if needed
        $scheme = parse_url($xmlrpcEndPoint, PHP_URL_SCHEME);
        if (!$scheme) {
            $xmlrpcEndPoint = "http://{$xmlrpcEndPoint}";
        }

        // swith to https when working with wordpress.com blogs
        $host = parse_url($xmlrpcEndPoint, PHP_URL_HOST);
        if (substr($host, -14) == '.wordpress.com') {
            $xmlrpcEndPoint = preg_replace('|http://|', 'https://', $xmlrpcEndPoint, 1);
        }

        // save information
        $this->endPoint = $xmlrpcEndPoint;
        $this->username = $username;
        $this->password = $password;
    }
function setCredentials ( $ xmlrpcEndPoint , $ username , $ password ) { // prepend http protocol to the end point if needed $ scheme = parse_url ( $ xmlrpcEndPoint , PHP_URL_SCHEME ) ; if ( ! $ scheme ) { $ xmlrpcEndPoint = "http://{$xmlrpcEndPoint}" ; } // swith to https when working with wordpress.com blogs $ host = parse_url ( $ xmlrpcEndPoint , PHP_URL_HOST ) ; if ( substr ( $ host , - 14 ) == '.wordpress.com' ) { $ xmlrpcEndPoint = preg_replace ( '|http://|' , 'https://' , $ xmlrpcEndPoint , 1 ) ; } // save information $ this -> endPoint = $ xmlrpcEndPoint ; $ this -> username = $ username ; $ this -> password = $ password ; }
Set the endpoint, username and password for next requests

@param string $xmlrpcEndPoint The wordpress XML-RPC endpoint
@param string $username       The client's username
@param string $password       The client's password

@since 2.4.0
Set the endpoint username and password for next requests