https://github.com/phpwine/winewpmenuwalker
WineWPMenuWalker Class
https://github.com/phpwine/winewpmenuwalker
menu plugins theme wordpress
Last synced: 2 months ago
JSON representation
WineWPMenuWalker Class
- Host: GitHub
- URL: https://github.com/phpwine/winewpmenuwalker
- Owner: PHPWine
- Created: 2023-11-24T07:20:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-24T13:01:55.000Z (over 2 years ago)
- Last Synced: 2025-07-21T13:48:23.599Z (12 months ago)
- Topics: menu, plugins, theme, wordpress
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WineWPMenuWalker
```PHP
/* Installation */
composer require phpwine/wpmenuwalker v1.4.1
/* required version *v2.0 */
composer require phpwine/optimizedhtml v2.0
```
```PHP
__( 'Primary menu', 'nielsoffice' )
);
register_nav_menus( $locations );
}
```
```PHP
// namespace
use \PHPWineWPWalker\WineWPMenuWalker;
// init custom menu
wp_nav_menu( array(
'theme_location' => 'main-menu',
'menu_id' => 'primary-menu',
'container' => 'nav',
'container_class' => 'menu-wine', // %1$s
'menu_class' => 'wine', // %2$s .... %3$s = list items.
'add_li_class' => 'pwine',
'items_wrap' => '
- %3$s
'walker' => new WineWPMenuWalker()
)
);
```
```HTML
```
```PHP
// Hooks sub-menu child parent [ assigned to depth]
function one_sub_menut_child( $depth, $args ) { /***/ }
// Hooks Replace Content menu specific item link
function Courses( $item, $depth, $args, $id ) { /***/ }
// Hooks Replace Content menu specific item no-link
function item_24Courses( $item, $depth, $args, $id ) { /***/ }
// Hooks insert element top and bottom from item
function top_Courses( $item, $depth, $args, $id ) { /***/ }
function bottom_Courses( $item, $depth, $args, $id ) { /***/ }
```
```PHP
// replace link || no-link
function item_27English() {
return [
child=> [
[h1, value=>["Hello Wolrd"]]
]
];
}
```