
Add menu separators to navigation
v2.1.3Mark Howells-Mead · 2016年5月4日 上架
Allow separator (HR / line) and unlinked, text-only entries in WordPress' classic navigation menus.
- 正在使用
- 900+
- 评分
- 5.0 / 5
- 累计下载
- 1.7 万
- 最近更新
- 2025年12月3日
3 条评价需要 WordPress 5.0+已测试到 6.9.0PHP 5.6+
Allow separator (HR / line) and unlinked, text-only entries in WordPress’ classic navigation menus.
Block editor
This plugin does not support the Block Editor or the navigation block. It is intended for use with the classic menus (e.g. wp_nav_menu).
Usage
- Upload the plugin folder to the
/wp-content/plugins/directory - Activate the plugin through the ‘Plugins’ menu in WordPress
- Edit your menu in the “Appearance” section of WordPress Admin. Add a custom link entry, then use
---(three dashes) as link text for a horizontal line or use#as a URL for an unlinked menu entry.
Filters
Version 2.1.0 of the plugin added two filters, with which developers can customise the output.
mhm-menu-separator/separatorallows customisation of a separator output. Receives the arguments'<hr class="mhm-menu-separator">'(the uncustomised HTML) and$item(the menu item).mhm-menu-separator/titleallows customisation of an unlinked menu entry. Receives the arguments$item->post_title(the plain, unlinked menu item text) and$item(the menu item).