[WordPress] 外掛分享: Dropdown multisite selector

前言介紹

  • 這款 WordPress 外掛「Dropdown multisite selector」是 2014-01-13 上架。
  • 目前有 1000 個安裝啟用數。
  • 上一次更新是 2025-03-26,距離現在已有 39 天。
  • 外掛最低要求 WordPress 3.8 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4.0 以上。
  • 有 19 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

alordiel |

外掛標籤

redirect | multisite | dropdown menu | flexible select | edit select options |

內容簡介

這個外掛可讓您創建完全可配置的下拉式選單,其選項將作為鏈接並將用戶重定向到所選選項。 它最初是為了多站點而建立,以加快在每個子站點之間的導航,但目前還支持從下拉選單中選擇自定義鏈接作為選項。

有三個選項:

手動配置下拉列表元素的選項數量-選擇選項的名稱和用戶選擇後將被重新導向的相關 URL;
從 WordPress 多站點網絡中獲取所有站點的任何列表-此選項從多站點網絡中挑選您所有站點的名稱並將其添加到選擇元素;
獲取與上一個相同的站點列表,但僅顯示當前登錄的用戶註冊的站點;

您可以管理:

選擇選項的名稱標籤,或將其留空;
您的第一個選擇選項(“選擇分支”,“選擇國家”,“選擇方”,等);
您自定義列表的排序(按字母順序排序+反向排序(您的最后輸入將成為下拉列表中的第一個));

保存設置後,您可以使用此短碼[dms]查看結果,或使用插件小工具。

短碼

[dms]-使用此短碼將生成在管理設置面板中配置的相同下拉式選單。

[dms_manual name=”Name” placeholder=”” target=”” options=””]-使用此選項可自定義下拉式選單,與您已設置的設置無關。 這個短碼的參數是:
- name-選擇選項的標籤(留空表示沒有標籤)
- placeholder-顯示在選擇菜單中的第一個選項(如:“-選擇-”)
- target-可以是“默認”或“空白”。 這是鏈接的目標-“空白”將在新窗口中打開
- options-名稱 - 鏈接對,應放置為:“url1 | name1,url2 | name2,url3 | name3”

例如:
[dms_manual name=”Label” placeholder=”-Select-” target=”blank” options=”Trusted search engine|https://duckduckgo.com, Tracking search engine|https://google.bg”]

如果您需要更多功能,請與我聯繫,以檢查我是否可以實現它。同樣感謝每個給我提示如何改進這個外掛的人。

代碼中的過濾器

這裡有一些過濾器,您可以使用它們來修改代碼的結果:
- dms_sites_arguments-在選擇“在 WMN 中顯示所有站點”的選項時,控制使用函數get_sites()中使用的屬性
- dms_multisite_pairs-過濾從get_sites()返回的結果。
- dms_users_sites-在選擇“僅顯示用戶註冊的站點”選項時,控制站點。

原文外掛簡介

With this plugin you can create fully configurable dropdown field which select options would work as links and will redirect the user to the selected one. It was originally built for multisite for faster navigation between each sub-site, but currently it also supports custom links as options from the dropdown.
There are three options:

manually configure the number of the options from the dropdown element – pick up a name of your option and the relevant url where the user will be redirected after choosing it;
get any list of all sites from WordPress Multisite network – this one picks the names of all your sites that are in the multisite network and adds them to the select element;
get the same list as previous one but only with the site where the current logged-in user is registered;

You can manage:

Your label for the name of the select option or leave it without label
Your first select option (‘Select branch’, ‘Select country’, ‘Choose Side’)
Sorting of your custom list (alphabetic sorting + reverse sorting (your last entries will become first in the dropdown))

Once you have saved your settings you can see the result using this shortcode [dms] or use the widget.
Shortcodes
[dms] – Using this shortcode will generate the same dropdown as the one you have configured in the admin settings panel.
[dms_manual name=”” placeholder=”” target=”” options=””] – Use this one your own dropdown that has nothing to do with the settings you have set. The arguments of this shortcode are:
* name – the label of the select option (leave empty for no label)
* placeholder – the first option that is shown in the select menu (like: “– Select –“)
* target – could be “default” or “blank”. This is the target of the link – “blank” is to be open in new window
* options – name-link pairs, should be placed as : “url1|name1, url2|name2, url3|name3”
An example:
[dms_manual name=”Label” placeholder=”–Select–” target=”blank” options=”Trusted search engine|https://duckduckgo.com, Tracking search engine|https://google.bg”]
If you would more functionality, please contact me to check if I can implement it. Also thanks to everyone giving me hints how to improve this plugin.
Filters in the code
Here are some filters that you can use to modify the results from the code:
* dms_sites_arguments – to control the attributes used in the function get_sites() when ‘Show all sites in the WMN’ option is selected.
* dms_multisite_pairs – filter the results returned from get_sites().
* dms_users_sites – control the sites when ‘Show only the sites where the user is registered’ option is selected.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Dropdown multisite selector」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.3.1 | 0.3.2 | 0.3.3 | 0.4.1 | 0.6.1 | 0.6.2 | 0.6.3 | 0.6.4 | 0.8.1 | 0.8.2 | 0.8.3 | 0.8.4 | 0.8.5 | 0.8.6 | 0.9.0 | 0.9.1 | 0.9.2 | 0.9.5 | 0.9.2.1 |

延伸相關外掛(你可能也想知道)

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon