[WordPress] 外掛分享: Swift Menu Duplicator

首頁外掛目錄 › Swift Menu Duplicator
WordPress 外掛 Swift Menu Duplicator 的封面圖片
全新外掛
安裝啟用
尚無評分
10 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.4+ v1.0.1 上架:2026-04-19

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.1) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Swift Menu Duplicator」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Swift Menu Duplicator gives you full control over your WordPress navigation menus. Clone any menu in one click, manage all menus from a dedicated admin page, version them with snapshots, move them across Multisite sub-sites, and automate everything from the command line or REST API.
One-Click Duplication

Duplicate button right in the menu editor footer — no page reload required
Full hierarchy preserved via a two-pass clone that remaps all parent-child item IDs
All item metadata copied — type, object, URL, target, CSS classes, XFN, description
Duplicate individual menu items directly from the menu editor
Custom name support — filter swift_menu_duplicator_new_menu_name to override the default “(Copy)” suffix

Snapshot Revisions

Auto-snapshot — a snapshot is saved automatically before every menu save
Manual snapshots — save named snapshots from the menu editor at any time
Browse & restore — view all snapshots in an expandable panel and restore with one click
Housekeeping — delete individual snapshots you no longer need

Menu Manager (Appearance → Menu Manager)

Dedicated page listing every menu on the site in a sortable WP_List_Table
Bulk duplicate — clone multiple menus at once
Bulk export — download selected menus as a single ZIP archive
Bulk delete — remove multiple menus in one action
Row actions — duplicate or export individual menus directly from the list

JSON Export / Import

Export any menu to a portable JSON file (via admin or REST API)
Import from a JSON file upload or paste JSON directly into the text area
URL find & replace — swap domain names during import for staging → production migrations
Dry-run preview — review what will be imported before making any changes to the database

Multisite Support

Copy any menu to another site in your WordPress Multisite network
Automatic URL rewriting in item URLs when copying across sub-sites

REST API
Full REST API at /wp-json/cmd/v1/ for headless and block-editor integrations:

POST /menus/{id}/duplicate — duplicate a menu (optional name parameter)
GET /menus/{id}/export — export a menu as a JSON payload
POST /menus/{id}/items/{item_id}/duplicate — duplicate a single menu item

Permission is controlled by the swmd_rest_permission filter (defaults to edit_theme_options).
WP-CLI
Full command-line support under the wp swift-menu-duplicator command group:

wp swift-menu-duplicator duplicate [--name=] — duplicate a menu
wp swift-menu-duplicator export [--output=] — export to JSON
wp swift-menu-duplicator import [--name=] [--find=] [--replace=] [--dry-run] [--porcelain] — import from JSON
wp swift-menu-duplicator copy-to-site --target-blog= [--name=] [--find=] [--replace=] — copy to a sub-site

Multilingual Compatibility

WPML — translation meta keys (_icl_lang_duplicate_of, wpml_language, etc.) are stripped from duplicated items automatically
Polylang — language meta keys (_pll_synced_taxonomies, _pll_menu_language, etc.) are stripped from duplicated items automatically
Additional keys can be excluded via the swmd_compat_excluded_meta_keys filter

Developer Hooks

swift_menu_duplicator_new_menu_name — customise the default duplicate name
swmd_rest_permission — control REST API access
swmd_before_duplicate_item / swmd_after_duplicate_menu_item — fired around item duplication
swmd_after_import_menu — fired after a successful import
swmd_item_meta_keys — control which meta keys are copied
swmd_compat_excluded_meta_keys — extend the multilingual meta exclusion list
wp_update_nav_menu — triggers auto-snapshot before every menu save

Security

All AJAX actions verified with nonces and edit_theme_options capability checks
All output escaped; all input sanitized
Database queries use $wpdb->prepare() — no string concatenation
REST API permission is filterable but defaults to edit_theme_options
WordPress Filesystem API used for all file read/write/delete operations

Requirements

WordPress 6.0 or higher
PHP 7.4 or higher
User with edit_theme_options capability

延伸相關外掛

文章
Filter
Apply Filters
Mastodon