

A mega menu panel with four navigation columns, opened on the front end.
Beplus Visual Mega Navigation adds a Gutenberg-powered mega menu builder to Appearance Menus. A top-level (depth-0) menu item can get a visual panel designed with the block editor instead of a plain sub-menu, and the panel is rendered on the front end by a menu walker that keeps keyboard and screen-reader behaviour intact.
aria-haspopup, aria-expanded, and aria-controls; Escape closes an open panel and moving focus out of the panel closes it.beplus-vmn-* classes and --beplus-vmn-mega-* CSS custom properties, and the width mode is exposed as has-mega-menu--{width} on the menu item.nav_menu_item post meta, and the legacy _jemented_megamenu_* keys are still read on migrated sites..nvmrc (currently 24).Templates are JSON files discovered from these locations. When the same slug exists in more than one place, the last location wins.
beplus-visual-mega-nav/templates/*.json (lowest priority).{theme}/mega-menu-templates/*.json.{child-theme}/mega-menu-templates/*.json (highest priority).Built-in templates:
featured-with-links — Featured + Links.mega-4-columns — 4 Columns.blog-and-quote-2-cols — Quotes + blog list.hero-artwork-3-cols — Hero Artwork 3 cols.A theme file with the same slug as a plugin template replaces the plugin version in the Import dropdown. Exported files use the same format, so you can drop an export into mega-menu-templates/ and add a slug to publish it in the store.
Each template is a single JSON object:
{
"slug": "my-custom-menu",
"title": "My Custom Menu",
"description": "Optional short description shown in the Import dropdown.",
"version": "1.0.0",
"settings": {
"width": "full",
"customWidth": 1200,
"position": "item-left",
"bgColor": "",
"animation": "fade"
},
"content": "Serialized block markup"
}
Fields:
slug — used as the filename ({slug}.json); falls back to the filename without .json.title — label shown in the Import dropdown.description — optional text shown under the title.version — template metadata only.settings — optional panel settings applied with the template.content — required, serialized block markup in the same format that is saved to the menu item.Panel settings keys:
width — full or custom.customWidth — panel width in pixels when width is custom (200–2400, default 780).position — item-left, item-center, or screen-center (used with a custom width).bgColor — panel background color as a hex value.animation — fade, slide, or none.Template content is sanitized on load with the same rules as saved mega menu content, so only blocks from the allowed list below are kept.
Core blocks available in the Content Builder: Columns, Column, Group, Row, Stack, Heading, Paragraph, List, List item, Image, Buttons, Button, Separator, Spacer, Cover, Page List, Shortcode, and Custom HTML.
Blocks added by this plugin:
Third-party blocks appear in the Content Builder once they are registered, and you can allow them with the beplus_vmn_allowed_blocks filter.
The admin screen uses these routes. All of them require the edit_theme_options capability.
GET /wp-json/beplus-visual-mega-nav/v1/item/{id} — read enabled, settings, and content for a menu item.POST /wp-json/beplus-visual-mega-nav/v1/item/{id} — save enabled, settings, and content.GET /wp-json/beplus-visual-mega-nav/v1/templates — list template summaries (slug, title, description, source).GET /wp-json/beplus-visual-mega-nav/v1/templates/{slug} — load one template, including settings and content.Filters provided by the plugin:
beplus_vmn_locations — theme locations that use the mega menu walker (default primary, main-menu, header).beplus_vmn_apply_walker — force the walker on or off for a given wp_nav_menu() call; return true or false.beplus_vmn_allowed_blocks — block names allowed in the Content Builder.beplus_vmn_template_directories — template scan directories, keyed by source label.beplus_vmn_templates — template list returned to the admin UI, keyed by slug.beplus_vmn_template_data — a single template before it is returned by the REST API.beplus_vmn_template_part_content — markup of a bundled block pattern before it is registered.beplus_vmn_link_item_attributes — Link Item block attributes before rendering.beplus_vmn_link_item_render_markup — rendered Link Item HTML.beplus_vmn_link_item_badge_variants — allowed badge variant slugs.Example: adding a custom block to the Content Builder.
add_filter( 'beplus_vmn_allowed_blocks', function ( array $blocks ): array {
$blocks[] = 'my-plugin/featured-card';
return $blocks;
} );
Example: adding a template directory.
add_filter( 'beplus_vmn_template_directories', function ( array $directories ): array {
$directories['my-plugin'] = plugin_dir_path( __FILE__ ) . 'mega-menu-templates';
return $directories;
} );
Each menu item stores three meta values on the nav_menu_item post:
_beplus_vmn_enabled — whether the item renders a mega panel._beplus_vmn_settings — JSON string with the panel settings listed above._beplus_vmn_content — serialized block markup.npm run start — watch admin assets.npm run build — production build into build/.composer check — PHP lint, PHPCS, PHPStan.npm run check:js — ESLint and Stylelint.