smartlogix/legacy-nav-menu-block
Composer 安装命令:
composer require smartlogix/legacy-nav-menu-block
包简介
A Gutenberg block that renders classic WordPress navigation menus via wp_nav_menu().
README 文档
README
A WordPress Gutenberg block that renders classic navigation menus via wp_nav_menu(). Designed as a standalone Composer library that any theme can include.
Features
- Menu selector — pick any registered nav menu from a dropdown
- Theme location — dynamically lists locations registered by the active theme via
register_nav_menus() - Container options —
<nav>,<div>, or no wrapper; custom CSS class andaria-label - Depth control — limit how many hierarchy levels to render
- Whitespace —
preserveordiscardwhitespace inside the HTML - Reusable — save as a synced pattern for use across the site
- Server-side rendered — live preview in the editor via
ServerSideRender - Automatically enables Appearance → Menus — even in block themes that don't declare
add_theme_support( 'menus' )
Requirements
| Requirement | Minimum |
|---|---|
| WordPress | 6.4+ |
| PHP | 7.4+ |
| Node.js (development only) | 20+ |
Installation
Via Composer (recommended)
composer require smartlogix/legacy-nav-menu-block
Then load Composer's autoloader in your theme's functions.php (if you haven't already):
require_once __DIR__ . '/vendor/autoload.php';
That's it — the block auto-registers via the autoloader. No additional code needed.
Manual installation
Download the release .zip from Releases, extract it into your theme, and require the bootstrap file:
require_once get_template_directory() . '/legacy-nav-menu-block/legacy-nav-menu.php';
Usage
Search for "Legacy Nav Menu" in the block inserter. Configure via the sidebar:
| Setting | Description |
|---|---|
| Menu | Select a specific nav menu or auto-select the first one |
| Theme Location | Pick a registered theme location; takes precedence over Menu |
| Container element | <nav> (default), <div>, or none |
| Container CSS class | Custom class on the container element |
| Container aria-label | Accessible label (only for <nav>) |
| Menu CSS class | Class applied to the <ul> |
| Depth | 0 = all levels; 1–10 limits hierarchy |
| Whitespace | Preserve or discard whitespace in HTML output |
Tip: If you want theme locations to appear in the block's dropdown, register them with
register_nav_menus()in your theme as usual. The block fetches available locations dynamically via the REST API.
Development
git clone https://github.com/namithj/legacy-nav-menu-block.git cd legacy-nav-menu-block npm install npm start # watch mode npm run build # production build npm run lint:js npm run lint:css
Releasing
- Update the version in
composer.json,package.json,block.json, andlegacy-nav-menu.php. - Run
npm run buildand commit the updatedbuild/directory. - Push to
main, then create a GitHub Release. - The Release workflow verifies the build and attaches a
.zipto the release. - Packagist auto-updates via its GitHub webhook.
License
GPL-2.0-or-later — see LICENSE.
smartlogix/legacy-nav-menu-block 适用场景与选型建议
smartlogix/legacy-nav-menu-block 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 02 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「menu」 「wordpress」 「block」 「navigation」 「wp_nav_menu」 「gutenberg」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 smartlogix/legacy-nav-menu-block 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 smartlogix/legacy-nav-menu-block 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 smartlogix/legacy-nav-menu-block 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Block routes by IP
A Symfony extension to get active class base on current bundle/controller/action
See how Matrix and Neo blocks are being used across your sections.
Prevent crawlers from creating a session
Yii2 DynaTree Menu widget uses Dynamic tree view control jquery.dynatree.js
This module is designed to provide a special alerts feed block for Howard University
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-02-19