Create new instance
This should be the full URL to the home page of the WordPress site. e.g. https://mysite.com
or https://mysite.com/blog/
.
For most WordPress installations, use 1
.
Optional
username: stringUsername to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.
Optional
password: stringPassword to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.
Run an XML-RPC API method on a WordPress site. Any method name supported by the WordPress XML-RPC API can be used, as long as the authentication information provided has appropriate permissions on the site.
The method name as documented in the WordPress XML-RPC API, for example wp.newPost
to create a new post.
Parameters should be a Javascript array of parameters for the method being used. These vary depending on the method and should follow the documentation provided by WordPress.
Static
createCreate new instance
This should be the full URL to the home page of the WordPress site. e.g. https://mysite.com
or https://mysite.com/blog/
.
For most WordPress installations, use 1
.
Optional
username: stringUsername to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.
Optional
password: stringPassword to login to the WordPress site. Optional if only using runMethod, as credentials will be required directly in parameters for those calls.
Script integration with WordPress sites via the WordPress XML-RPC API. Currently this object has one runMethod function which can be used to call any method available in the XML-RPC interface.
The WordPress API offers access to a wide variety of functions, including posting, but also retrieving information about categories and tags, or reading posts contents.
Drafts
WordPress
object simplifies working with the XML-RPC interface by accepting input parameters as Javascript objects and converting them to the require XML to make requests of the WordPress site. Similarly, it converts to XML returned by WordPress to Javascript objects. Otherwise it is an exact passthrough, so the WordPress API reference should be used to determine method names (e.g.wp.newPost
,wp.getTaxonomies
) available, the appropriate parameters to send.The WordPress XML-RPC API authenticates via username and password, so it is highly recommended you interact only over HTTPS secure connections, and use
Credential
objects to store host/username/password values, rather than hard-coding them in actions.Example