
內容簡介
總結:
PDF Menu Linker是一個小型的僅供管理員使用的外掛程式,可輕鬆在導覽選單中新增和管理 PDF 連結。它在外觀→選單中新增了專用的PDF面板,以及在PDF選單項目上添加了一個Replace PDF控制功能,因此您可以在不重新創建選單項目或手動觸碰URL的情況下更換文件。
問題與答案:
- PDF Menu Linker是一個用於何種用途的 WordPress 外掛?
- 用於在導覽選單中新增和管理 PDF 連結。
- 如何在 WordPress 中新增一個新的 PDF 選單項目?
- 1. 進入 WordPress 管理員頁面,前往外觀→選單。
2. 確保已選擇一個選單(或創建一個並保存)。
3. 在「新增選單項目」列中,打開PDF面板。
4. 點選「選擇 PDF」並從媒體庫中選擇一個文件(僅限 PDF)。
5. 可選地調整連結文本和標題。
6. 點選「新增至選單」。
7. 一個指向該PDF的新自定義連結將出現在選單結構的底部,並在前端以新分頁方式打開。
- 如何替換現有選單項目中的 PDF 文件?
- 1. 在外觀→選單中,找到URL結尾為 .pdf 的自定義連結。
2. 展開該選單項目。
3. 點選URL字段旁的「替換PDF」。
4. 從媒體庫中選擇新的PDF並確認。
5. URL字段將更新為新的PDF,而導覽標籤和標題屬性保持不變。
外掛標籤
開發者團隊
原文外掛簡介
PDF Menu Linker is a small admin-only plugin that makes it easy to add and manage PDF links in navigation menus.
It adds a dedicated PDFs panel to Appearance → Menus, and a Replace PDF control on PDF menu items, so you can swap files without recreating menu items or touching URLs manually.
Features
PDFs panel on the Menus screen – Select a PDF from the Media Library and add it directly to any navigation menu.
Automatic link text and title – Link Text and Link Title fields default from the PDF filename (without the extension), and can be edited before adding.
One-click Add to Menu – Creates a standard custom menu item that opens the PDF in a new tab, using WordPress core menu APIs.
Replace PDF on existing items – For custom links that point to a .pdf, a Replace PDF button appears next to the URL field so you can change the file without changing labels.
Native WordPress UX – Uses WordPress’ Media Library, menu editor, styling, permissions, and nonces. No custom tables or front‑end changes.
Requirements
WordPress 6.0 or higher
PHP 7.4 or higher
A user role with permission to manage menus (typically users who can edit_theme_options).
Usage
Add a new PDF menu item
In the WordPress admin, go to Appearance → Menus.
Ensure a menu is selected (or create one and save it).
In the Add menu items column, open the PDFs panel.
Click Select PDF and choose a file from the Media Library (PDFs only).
Optionally adjust Link Text and Link Title.
Click Add to Menu.
A new Custom Link pointing at the PDF will appear at the bottom of the menu structure and will open in a new tab on the front end.
Replace the PDF for an existing menu item
In Appearance → Menus, locate a Custom Link whose URL ends with .pdf.
Expand the menu item.
Click Replace PDF next to the URL field.
Choose a new PDF from the Media Library and confirm.
The URL field updates to the new PDF, while Navigation Label and Title Attribute remain unchanged.
