Created
September 25, 2022 22:36
-
-
Save rahulbanerjee26/7cc881d668c51a268e836088b65d0e97 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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