PDF Menu Linker

外掛說明

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

  1. In the WordPress admin, go to Appearance Menus.
  2. Ensure a menu is selected (or create one and save it).
  3. In the Add menu items column, open the PDFs panel.
  4. Click Select PDF and choose a file from the Media Library (PDFs only).
  5. Optionally adjust Link Text and Link Title.
  6. Click Add to Menu.
  7. 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

  1. In Appearance Menus, locate a Custom Link whose URL ends with .pdf.
  2. Expand the menu item.
  3. Click Replace PDF next to the URL field.
  4. Choose a new PDF from the Media Library and confirm.
  5. The URL field updates to the new PDF, while Navigation Label and Title Attribute remain unchanged.

螢幕擷圖

安裝方式

  1. Upload the pdf-menu-linker folder to the /wp-content/plugins/ directory, or install the plugin via the Plugins screen.
  2. Activate PDF Menu Linker through the Plugins Installed Plugins screen.

常見問題集

Does this plugin change how menus render on the front end?

No. The plugin only runs in the admin and creates standard custom menu items that WordPress already knows how to render.

Where are PDFs and menu items stored?

PDFs are normal media attachments in the Media Library, and menu items are standard nav_menu_item posts with their usual meta fields. The plugin does not create custom tables.

使用者評論

閱讀全部 1 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈PDF Menu Linker〉的開發相關工作。

參與者

將〈PDF Menu Linker〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0

  • Initial release.