WordPress XML-RPC client.
- Automated batching of RPC calls.
Instance methods resemble WordPress functions used in PHP development.
- client.get_post()
- client.get_option()
- client.insert_post()
- client.upload_file()
// Load module and create an instance.
var client = require( 'wordpress-client' ).create({
url: 'http://my-site.com/xmlrpc.php',
username: 'admin',
password: 'secret-password'
});
// Uplaod File
client.uploadFile({
'name': 'My File',
'bits': require( 'fs' ).readFileSync( './path/to/file.jpeg' )
});- All callbacks are called in context of client's instance.
- Authenticated vs non-authenticated calls are automatically selected based on type of endpoint.