objectivco/network-subsite-menu
Composer 安装命令:
composer require objectivco/network-subsite-menu
包简介
README 文档
README
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:
wp_nav_menu( array('menu' => 'network_subsite_menu') );
In reality, the plugin doesn't really use wp_nav_menu, 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:
cgd_network_subsite_menu_settings
Filter the whole settings object. You could change the order of menu items here.
cgd_network_subsite_menu_before
Lets you insert menu items before the main menu item loop.
cgd_network_subsite_menu_after
Lets you insert menu items after the main menu item loop.
cgd_network_subsite_menu_site_info
Filter the url, label, and set whether or not the current menu item is the current one.
To see how these actually work, look at the code dawg.
objectivco/network-subsite-menu 适用场景与选型建议
objectivco/network-subsite-menu 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.77k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2018 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 objectivco/network-subsite-menu 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 objectivco/network-subsite-menu 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.77k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2018-01-18