Hi Luca,
The plugin doesn’t actually treat the Menu Sections as hierarchical. So if you nest one section under another section, it won’t load and display child sections or anything. It behaves as if the sections are not hierarchical.
However, if all you want is the default hierarchical UI, you can make the change and the plugin should still load sections fine. You can hook into [this filter](https://github.com/NateWr/food-and-drink-menu/blob/master/cpts.php#L108) to make the change without touching the plugin.
Thread Starter
lucspe
(@lucspe)
Hi,
Thanks for the reply.
I’ve tried adding hierarchical without rewriting the whole array using the following code, but it doesn’t work:
add_filter( 'fdm_menu_item_args', 'fdm_hierarchical_taxonomies' );
function fdm_hierarchical_taxonomies( $menu_item_taxonomies ) {
$menu_item_taxonomies['hierarchical'] = 'true';
return $menu_item_taxonomies;
}
any idea of what I am doing wrong?
Hi Luca,
You want to hook into the menu item taxonomy arguments filter, which is fdm_menu_item_taxonomies
, not fdm_menu_item_args
. You can find the correct filter here.
Thread Starter
lucspe
(@lucspe)
Ok, thanks, my mistake (lesson learned not to look at these things at 3am in the night, my timezone 🙂 )
At any rate, this seems to work, in case anybody else needs it:
add_filter( 'fdm_menu_item_taxonomies', 'fdm_hierarchical_taxonomies' );
function fdm_hierarchical_taxonomies( $menu_item_taxonomies ) {
$menu_item_taxonomies['fdm-menu-section']['hierarchical'] = 'true';
return $menu_item_taxonomies;
}
Thanks again.
Thanks for sharing the final result Luca. If you get a chance, please leave a review for the plugin.