stylight / python-wordpress-json

Thin Python wrapper for the Wordpress REST API
MIT License
42 stars 19 forks source link

How can i create new post? #21

Open d1rengrey opened 4 years ago

happyraul commented 4 years ago

It would be something like:

>>> from wordpress_json import WordpressJsonWrapper
>>> wp = WordpressJsonWrapper('http://example.com/wp-json/wp/v2', 'wp_user', 'wp_password')
>>> wp.create_post(data=dict(title='A treatise', status='draft'))

Given the right version of wordpress this would work, but this library is not maintained for newer versions, so YMMV.