Closed metawise closed 5 years ago
I was able to achieve that by editing the code a bit.
The "wp_api_v2_menus_get_menu_items' function to be more specific.
See image:
Awesome! I will try that. I was able to achieve with the different plugin but this one seems later version.
Hi, I resolved the issue implementing a new function to check menu item's relatives. I will release a new version of the plugin ASAP.
I was able to achieve that by editing the code a bit.
The "wp_api_v2_menus_get_menu_items' function to be more specific.
See image:
Replace the line unset($menu_items[$key2])
with array_splice($menu_items, $key2, 1)
. Otherwise the array won't start at an index of 0, which will cause a problem when fetching it as JSON, because JSON converts arrays into objects when the index doesn't start with 0. (Which caused the problem for me that I couldn't use array.map() inside a React application)
Reference: Stackoverflow
@thebatclaudio
Hi @josias-r, thank you for your advice. I will fix it ASAP.
I created another issue (#18)
The plugin not supporting more than 2 levels of menus.