diff --git a/lib/WPMenu.py b/lib/WPMenu.py index 5883808..33178a9 100644 --- a/lib/WPMenu.py +++ b/lib/WPMenu.py @@ -134,4 +134,17 @@ class WPMenu: for i in range(0, len(menu)): 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"])) \ No newline at end of file