[WordPress] 外掛分享: Add menu separators to navigation

首頁外掛目錄 › Add menu separators to navigation
WordPress 外掛 Add menu separators to navigation 的封面圖片
1,000+
安裝啟用
★★★★★
5/5 分(3 則評價)
107 天前
最後更新
問題解決
WordPress 5.0+ PHP 5.6+ v2.1.3 上架:2016-05-03

內容簡介

讓 WordPress 經典導覽選單支援分隔線(HR / 水平線)和未連結的純文字項目。

區塊編輯器

本外掛不支援區塊編輯器或導覽區塊。它適用於使用 WordPress 經典導覽選單(例如wp_nav_menu)。

使用方法

上傳外掛資料夾到/wp-content/plugins/目錄
透過 WordPress 中的「外掛」菜單啟用該外掛程式
在 WordPress 管理後台的「外觀」部分中編輯您的選單。添加自定義鏈接項目,然後使用---(三條破折號)作為水平線的鏈接文本,或者使用#作為未連結的選單鏈接。

篩選器

本外掛的 2.1.0 版本新增了兩個篩選器,開發者可以使用這些篩選器自定義輸出。

mhm-menu-separator/separator 允許自定義分隔線的輸出。它接收參數 '<hr class="mhm-menu-separator">'(未自定義的 HTML)和 $item(選單項目)。
mhm-menu-separator/title 允許自定義未連結的選單項目。它接收參數 $item->post_title(純文本未連結的選單項目)和 $item(選單項目)。

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.1.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Add menu separators to navigation」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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/separator allows customisation of a separator output. Receives the arguments '


' (the uncustomised HTML) and $item (the menu item).
mhm-menu-separator/title allows customisation of an unlinked menu entry. Receives the arguments $item->post_title (the plain, unlinked menu item text) and $item (the menu item).

延伸相關外掛

文章
Filter
Apply Filters
Mastodon