wordpress-rpc

A Request-Wrapper for the XML-RPC API of Wordpress

Usage no npm install needed!

<script type="module">
  import wordpressRpc from 'https://cdn.skypack.dev/wordpress-rpc';
</script>

README

Wordpress-RPC

Module for remote Wordpress control over the XML-RPC API. Supports API-Request listed on XML-RPC with JSON.

Example for a getPosts

  var rpc = require('wordpress-rpc'); 
  var wp = new rpc();
  var parameter = [
    1,
    username,         //set your username
    password          //set your password
  ];
  
  
  wp.call('getPosts', parameter, function(err, data){
    console.log(data);
  });

default Options

  var options = {
    https : false,
    host : 'localhost',
    port : 80,
    path : '/xmlrpc.php'
  }
  
  var wp = new rpc(options);