2 code formatting
source | link

Okay, I was being stupid, so I stopped that.

I'd assumed that a) any answer older than two years would be out-of-date; b) I'd need a special WP flavor of the base IXR library; I was confused, and took the sparseness of the wp.org documentation as "they're not telling the whole story" instead of "the tool is very basic at the use interface."

This code works, in conjunction with the IXR library found at incutio.com:

//php wrapper fore and aft, obviously

include('IXR_Library.php');

$usr = 'theusername'; $pwd = 'thepassword'; $xmlrpc = 'http://not-therealurl.com/xmlrpc.php'; $client = new IXR_Client($xmlrpc);

$client->debug = true; //optional but useful

$params = array( 'post_type' => 'post', 'post_status' => 'draft', 'post_title' => 'Test Post', 'post_author' => 4, 'post_excerpt' => 'This is my test excerpt', 'post_content' => 'This is my test post. Now its longer than the excerpt.' );

$res = $client->query('wp.newPost',1, $usr, $pwd, $params);

include('IXR_Library.php');

$usr = 'theusername';
$pwd = 'thepassword';
$xmlrpc = 'http://not-therealurl.com/xmlrpc.php';
$client = new IXR_Client($xmlrpc);

$client -> debug = true; //optional but useful

$params = array(
    'post_type' => 'post',
    'post_status' => 'draft',
    'post_title' => 'Test Post',
    'post_author' => 4,
    'post_excerpt' => 'This is my test excerpt',
    'post_content' => 'This is my test post. Now its longer than the excerpt.'
);

$res = $client -> query('wp.newPost',1, $usr, $pwd, $params);

Okay, I was being stupid, so I stopped that.

I'd assumed that a) any answer older than two years would be out-of-date; b) I'd need a special WP flavor of the base IXR library; I was confused, and took the sparseness of the wp.org documentation as "they're not telling the whole story" instead of "the tool is very basic at the use interface."

This code works, in conjunction with the IXR library found at incutio.com:

//php wrapper fore and aft, obviously

include('IXR_Library.php');

$usr = 'theusername'; $pwd = 'thepassword'; $xmlrpc = 'http://not-therealurl.com/xmlrpc.php'; $client = new IXR_Client($xmlrpc);

$client->debug = true; //optional but useful

$params = array( 'post_type' => 'post', 'post_status' => 'draft', 'post_title' => 'Test Post', 'post_author' => 4, 'post_excerpt' => 'This is my test excerpt', 'post_content' => 'This is my test post. Now its longer than the excerpt.' );

$res = $client->query('wp.newPost',1, $usr, $pwd, $params);

Okay, I was being stupid, so I stopped that.

I'd assumed that a) any answer older than two years would be out-of-date; b) I'd need a special WP flavor of the base IXR library; I was confused, and took the sparseness of the wp.org documentation as "they're not telling the whole story" instead of "the tool is very basic at the use interface."

This code works, in conjunction with the IXR library found at incutio.com:

include('IXR_Library.php');

$usr = 'theusername';
$pwd = 'thepassword';
$xmlrpc = 'http://not-therealurl.com/xmlrpc.php';
$client = new IXR_Client($xmlrpc);

$client -> debug = true; //optional but useful

$params = array(
    'post_type' => 'post',
    'post_status' => 'draft',
    'post_title' => 'Test Post',
    'post_author' => 4,
    'post_excerpt' => 'This is my test excerpt',
    'post_content' => 'This is my test post. Now its longer than the excerpt.'
);

$res = $client -> query('wp.newPost',1, $usr, $pwd, $params);
1
source | link

Okay, I was being stupid, so I stopped that.

I'd assumed that a) any answer older than two years would be out-of-date; b) I'd need a special WP flavor of the base IXR library; I was confused, and took the sparseness of the wp.org documentation as "they're not telling the whole story" instead of "the tool is very basic at the use interface."

This code works, in conjunction with the IXR library found at incutio.com:

//php wrapper fore and aft, obviously

include('IXR_Library.php');

$usr = 'theusername'; $pwd = 'thepassword'; $xmlrpc = 'http://not-therealurl.com/xmlrpc.php'; $client = new IXR_Client($xmlrpc);

$client->debug = true; //optional but useful

$params = array( 'post_type' => 'post', 'post_status' => 'draft', 'post_title' => 'Test Post', 'post_author' => 4, 'post_excerpt' => 'This is my test excerpt', 'post_content' => 'This is my test post. Now its longer than the excerpt.' );

$res = $client->query('wp.newPost',1, $usr, $pwd, $params);