admin管理员组文章数量:1287971
The start_lvl() method allows to know the current $depth
parameter. But, I need to output different results at level 1 if the menu has x or y total levels.
I did a print_r()
of the $args
array, but there isn't anything I can use to achieve the desired result:
<!--Custom_Menu_Walker Object
(
[tree_type] => Array
(
[0] => post_type
[1] => taxonomy
[2] => custom
)
[db_fields] => Array
(
[parent] => menu_item_parent
[id] => db_id
)
[max_pages] => 1
[has_children] => 1
)
-->
The most useful thing is to know if the current level has children. And even that isn't supposed to be used in the walker level
:
From the docs: Whether the current element has children or not. To be used in start_el().
And even though it can be accessed from level, it doesn't allow me to know if any of the children have more children.
How do you suggest to approach this?
本文标签: WP Menu WalkerHow to know total depth from inside the startlvl() method
版权声明:本文标题:WP Menu Walker - How to know total depth from inside the start_lvl() method 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741330060a2372718.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论