Skip to content

Instantly share code, notes, and snippets.

@rahulbanerjee26
Created September 25, 2022 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahulbanerjee26/7cc881d668c51a268e836088b65d0e97 to your computer and use it in GitHub Desktop.
Save rahulbanerjee26/7cc881d668c51a268e836088b65d0e97 to your computer and use it in GitHub Desktop.
def create_post_wordpress(
self,
title,
content,
publish_status="draft",
categories=[],
tags=[],
featuredImageId=None,
):
response = self.session.post(
f"{self._endpoint}posts",
json={
"title": title,
"content": content,
"status": publish_status,
"categories": categories,
"tags": tags,
"featured_media": featuredImageId,
},
)
return response.json()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment