PHPackages                             iantsch/mu-nav-menu - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. iantsch/mu-nav-menu

ActiveWordpress-muplugin

iantsch/mu-nav-menu
===================

WordPress must-use plugin to register a custom extended front-end menu walker and new wrapper function for BEM styled CSS classes.

0.2.2(8y ago)39MITPHPPHP &gt;=7.0

Since Jan 28Pushed 7y agoCompare

[ Source](https://github.com/iantsch/mu-nav-menu)[ Packagist](https://packagist.org/packages/iantsch/mu-nav-menu)[ RSS](/packages/iantsch-mu-nav-menu/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

WordPress Menu Walker with BEM classes
======================================

[](#wordpress-menu-walker-with-bem-classes)

WordPress must-use plugin to register a custom extended front-end menu walker and new wrapper function for BEM styled CSS classes.

Installation
------------

[](#installation)

You can install this must-use plugin two ways

### Via Composer

[](#via-composer)

If you load your dependenies via Composer you can load this plugin with

```
$ php composer require iantsch/mu-nav-menu
```

### Via Download

[](#via-download)

Download/fork this repository and copy the contents of this must-use plugin into `wp-content/mu-plugins/`. If you visit your Plugin section in the `wp-admin` area, you should be able to see a newly created category (Must use) plugins

Usage
-----

[](#usage)

A ready-to-use wrapper function `bem_nav_menu` for `wp_nav_menu` is included

```
$args = array(
    'base_class' => 'main-menu', // Optional. Default: menu
    'theme_location' => 'main-menu'
);
bem_nav_menu($args);
```

You have an additional argument to name your block to your convenience with the argument `base_class`.

Filter Hooks
------------

[](#filter-hooks)

Yes, you can easily adapt the functionality of this walker with the already known filter hooks and a few custom ones.

### MBT/WalkerNavMenu/renderToggle - string $title

[](#mbtwalkernavmenurendertoggle---string-title)

ParameterDefaultFunctionality`boolean $render`trueEnables the rendering of an no-JS toggle with radioboxes### MBT/WalkerNavMenu/menuToggleTitle

[](#mbtwalkernavmenumenutoggletitle)

ParameterDefaultFunctionality`string $title`title attribute for toggle anchorTo localize this string add a filter.### MBT/WalkerNavMenu/menuToggleContent

[](#mbtwalkernavmenumenutogglecontent)

ParameterDefaultFunctionality`string $content`string of a caret SVGAn additional toggle item for nested menus.### MBT/WalkerNavMenu/autoArchiveMenu

[](#mbtwalkernavmenuautoarchivemenu)

ParameterDefaultFunctionality`boolean $render, int $depth, object $item`falseEnables an automated post type archive sub menu### MBT/WalkerNavMenu/autoTaxonomyMenu

[](#mbtwalkernavmenuautotaxonomymenu)

ParameterDefaultFunctionality`boolean $render, int $depth, object $item`falseEnables an automated posts per term of taxonomy sub menu### MBT/WalkerNavMenu/PostTypeArchive/queryArgs/postType={$postType}

[](#mbtwalkernavmenuposttypearchivequeryargsposttypeposttype)

ParameterDefaultFunctionality`array $query_args`[see below](#default-post-type-archive-arguments)Adapt the automated sub menu query for $postType#### Default post type archive arguments

[](#default-post-type-archive-arguments)

```
array(
    'post_type' => $item->object,
    'posts_per_page' => -1,
    'post_parent' => 0,
)
```

### MBT/WalkerNavMenu/TermChildren/queryArgs/taxonomy={$taxonomy}

[](#mbtwalkernavmenutermchildrenqueryargstaxonomytaxonomy)

ParameterDefaultFunctionality`array $query_args`[see below](#default-term-children-arguments)Adapt the automated sub menu query for $taxonomy#### Default term children arguments

[](#default-term-children-arguments)

```
array(
    'post_type' => $taxonomy->object_type,
    'posts_per_page' => -1,
    'post_parent' => 0,
    'tax_query' => array(
        array(
            'taxonomy' => $item->object,
            'field' => 'id',
            'terms' => $item->object_id
        )
    )
)
```

### MBT/WalkerNavMenu/mobileMenuContent

[](#mbtwalkernavmenumobilemenucontent)

ParameterDefaultFunctionality`string $content`string of html for the mobile toggleAn additional toggle item for mobile menus (burger).Credits
-------

[](#credits)

[@iantsch](https://twitter.com/iantsch) - [web developer](https://mbt.wien) behind this and other projects.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3028d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/49e94c3b17e381fbdc139257000ad944d117dec0eb6d765879d8e1bcd40f7b1f?d=identicon)[iantsch](/maintainers/iantsch)

---

Top Contributors

[![iantsch](https://avatars.githubusercontent.com/u/22318501?v=4)](https://github.com/iantsch "iantsch (12 commits)")

---

Tags

wordpresswordpress-mu-pluginwordpress-nav-menu-walkerwordpressplugins

### Embed Badge

![Health badge](/badges/iantsch-mu-nav-menu/health.svg)

```
[![Health](https://phpackages.com/badges/iantsch-mu-nav-menu/health.svg)](https://phpackages.com/packages/iantsch-mu-nav-menu)
```

###  Alternatives

[tgmpa/tgm-plugin-activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).

1.8k222.5k13](/packages/tgmpa-tgm-plugin-activation)[balbuf/composer-wp

Manage WordPress core, plugins, and themes with composer.

173.6k](/packages/balbuf-composer-wp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
