How to make a message in wordpress using api?

How can I remotely record a user’s blog after he gives me his login information using the wordpress api? What method should I use, what parameters should it have, etc.? Sample code will be great.

I would prefer to use the XML-RPC api, but others would also be acceptable.

+5
source share
3 answers

Yes, you can use metaWeblog.newPost or blogger.newPost , an example of the first:

http://www.wprecipes.com/post-on-your-wordpress-blog-using-php

uses curl and xmlrpc_encode_request

second example:

http://www.nickycakes.com/post-to-wordpress-remotely-with-xmlrpc-in-php/

yes and @ francis right

+6
source

I personally use the JSON API plugin. Create a message using:

 http://www.example.com/api/create_post/?nonce=123456789&title=My%20Post&status=publish 
+1
source

Source: https://habr.com/ru/post/1299226/


All Articles