parent comment 90%
This commit is contained in:
parent
581b6941a6
commit
4cf301b216
@ -215,6 +215,18 @@ class WPimport:
|
||||
if page.status_code == 200:
|
||||
self._logger.info("Commentaire mise à jour pour {0}".format(title))
|
||||
else:
|
||||
if i["parent_id"] != -1:
|
||||
parent_id = int(i["parent_id"])
|
||||
try:
|
||||
page = self._request.get("http://{0}/wp-json/wp/v2/comments".format(self._wordpress), auth=self._basic, params=params)
|
||||
except Exception as err:
|
||||
self._logger.error("Connection error : {0}".format(err))
|
||||
exit(1)
|
||||
if page.status_code == 200:
|
||||
result = page.json()
|
||||
for j in result:
|
||||
if comment[parent_id]["author"] == j["author_name"] and comment[parent_id]["date"] == j["date"]:
|
||||
data["parent"]=j["id"]
|
||||
try:
|
||||
page = self._request.post("http://{0}/wp-json/wp/v2/comments".format(self._wordpress), auth=self._basic, data=data)
|
||||
except Exception as err:
|
||||
|
Loading…
x
Reference in New Issue
Block a user