Network Subsite Menu
Create a global subsite menu for WordPress multisite.
★ 4stars
1.8kcomposer installs
2forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/clifgriffin/network-subsite-menu/archive/refs/heads/master.zipAlso on Packagist as objectivco/network-subsite-menu:
composer require objectivco/network-subsite-menuFrom the readme
Network Subsite Menu
Posted in case anyone finds it useful. This is definitely a scratch your own niche (get it??) kind of plugin.
Basically, if you have a multisite and you want to create a global menu with some or all of your subsites and show which subsite you're on, this will help you build that menu.
To use it, Network Activate it and then go to Settings - Network Menu.
You'll see a list of your subsites, with a checkbox to enable or disable that subsite in the menu. There is also a field to set the menu label.
Implementation
Once you've configured it, just drop this somewhere:
In reality, the plugin doesn't really use wpnavmenu, so you're going to be pretty dissappointed if you try to pass other options. It's building out the menu manually, using the standard WordPress nav menu HTML and then circumventing the whole nav menu function by directly returning the output.
The only parameter that will work is echo.
Filters
If you need anything beyond the basics, these filters should get you there in theory:
cgdnetworksubsitemenusettings
Filter the whole settings object. You could change the order of menu items here.
cgdnetworksubsitemenubefore
Lets you insert men