1

I'm using the wordpresslib library to make posts to my wordpress website.

I'm trying to now edit older post using the library, but am unsure of where to even start.
Their example does not show how to edit post only how to create basic posts.

I have been looking around and cant really seem to find anyone posting about wordpresslib. If anyone has any experience with it and could point me in the right direction that would be very helpful!

1 Answer 1

1

After going over the wordpresslib.py file I figured out how to edit previous posts. Anyone that needs to do the same please see the example below:

include wordpresslib

wp = wordpresslib.WordPressClient(*URL*, *USERNAME*, *PASSWORD*)

lastPost = wp.getLastPost() #access the last post created
lastPost.description = "edits to be made" #edit the post description

postEdit = wp.editPost(lastPost.id, lastPost, True) #post edit
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.