This commit is contained in:
Valentin CZERYBA 2023-07-13 00:09:18 +02:00
parent dded126926
commit e6328135da

View File

@ -134,4 +134,17 @@ class WPMenu:
for i in range(0, len(menu)): for i in range(0, len(menu)):
self._logger.info("{0} : Menu {1} {2}".format(self._name, menu[i]["title"], len(menu[i]["children"]))) self._logger.info("{0} : Menu {1} {2}".format(self._name, menu[i]["title"], len(menu[i]["children"])))
if menu[i]["title"] != "home":
for j in range(0, len(menu[i]["children"])):
idMenu = self._getId(menu[i]["children"][j]["title"])
if idMenu != 0:
menu[i]["children"][j] = {"id":idMenu, "title": menu[i]["children"][j]["title"], "parent": menu[i]["children"][j]["parent"]}
idMenu = self._getId(menu[i]["title"])
if idMenu != 0:
menu[i] = {"id":idMenu, "title":menu[i]["title"], "children": menu[i]["children"]}
for i in menu:
self._logger.info("{0} Menu parent {1} with id : {2}".format(self._name, i["title"], i["id"]))
for j in i["children"]:
self._logger.info("{0} Menu children {1} with id : {2}".format(self._name, j["title"], j["id"]))