admin管理员组文章数量:1130349
Does anyone know what is the difference between extending Walker_Nav_menu and walker. I learned about Wordpress Nav Walker and found several different tutorials. Do they extends different classes ?
Does anyone know what is the difference between extending Walker_Nav_menu and walker. I learned about Wordpress Nav Walker and found several different tutorials. Do they extends different classes ?
1 Answer
Reset to default 0Walker_Nav_menu extends walker and includes all the markup for a menu. walker by itself doesn't have any markup, it just handles walking the tree, and needs to be extended to add markup. See the documentation:
Extend the Walker class to use it, see examples below. Child classes do not need to implement all of the abstract methods in the class. The child only needs to implement the methods that are needed.
If you're customising the output of a menu, just extend Walker_Nav_Menu.
Does anyone know what is the difference between extending Walker_Nav_menu and walker. I learned about Wordpress Nav Walker and found several different tutorials. Do they extends different classes ?
Does anyone know what is the difference between extending Walker_Nav_menu and walker. I learned about Wordpress Nav Walker and found several different tutorials. Do they extends different classes ?
1 Answer
Reset to default 0Walker_Nav_menu extends walker and includes all the markup for a menu. walker by itself doesn't have any markup, it just handles walking the tree, and needs to be extended to add markup. See the documentation:
Extend the Walker class to use it, see examples below. Child classes do not need to implement all of the abstract methods in the class. The child only needs to implement the methods that are needed.
If you're customising the output of a menu, just extend Walker_Nav_Menu.
本文标签: phpDifference between quotWalkerNavmenuquot and quotwalkerquot
版权声明:本文标题:php - Difference between "Walker_Nav_menu" and "walker" 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749051790a2308730.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论