最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

php - Difference between "Walker_Nav_menu" and "walker"

matteradmin10PV0评论

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 ?

Share Improve this question edited Jan 2, 2019 at 7:38 Pratik Patel 1,1091 gold badge11 silver badges23 bronze badges asked Jan 2, 2019 at 4:55 hai indoshai indos 1
Add a comment  | 

1 Answer 1

Reset to default 0

Walker_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.

Post a comment

comment list (0)

  1. No comments so far