[WordPress] 外掛分享: Exclude Pages

前言介紹

  • 這款 WordPress 外掛「Exclude Pages」是 2007-09-21 上架。
  • 目前有 30000 個安裝啟用數。
  • 上一次更新是 2017-11-28,距離現在已有 2714 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.2.3 以上版本才可以安裝。
  • 有 47 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

simonwheatley |

外掛標籤

menu | get_pages | hide pages | navigation | exclude pages |

內容簡介

這個外掛新增了一個勾選框,「在選單中包含此頁面」,取消勾選則排除使用者在您的網站上看到的頁面導覽中的頁面。

如有問題:聯繫我。此插件新增了一個勾選框「在選單中包含此頁面」,預設已勾選,取消勾選後,此頁面將不會出現在任何頁面列表中(包括且通常限定在您的頁面導覽選單)。

在排除的頁面的子頁面也不會顯示在選單列表中(在編輯畫面下,「包含」勾選框下方的提醒讓您跟踪哪個祖先頁面會影響子頁面的方式。)

進階使用

可以使用新的樣板標籤,暫時中斷或恢復排除頁面的效果。下列代碼將顯示您網站中所有頁面的列表,即使那些通常被隱藏的頁面也會顯示:


Pages' ); ?>

您也可以通過調用函數ep_get_excluded_ids();來獲取被排除頁面的ID數組,然後按照您的需求使用這些ID(例如,將它們作為原始MySQL查詢的輸入)。

向其他外掛作者說明:

如果使用者在管理頁面上,則這個外掛不會作用於wp_list_pages,如果這是一個問題,您可以利用ep_admin_bail_out過濾器並創建過濾器函數,返回false以允許Exclude Pages在管理區域中運作。

另一個注意事項:

如果您的外掛或主題未使用標準的WordPress功能來創建其菜單,那它們將無法正常工作。要使它們正常工作,您需要找到在主題/外掛中獲取頁面的代碼段並更改為應用過濾器“get_pages”(我對您所做的更改造成的任何無法預見的後果概不負責,因此請仔細測試)獲取頁面的更改可能會類似於以下代碼:

$pages = apply_filters( 'get_pages', $pages );

如果您完全無法解決問題,請聯繫我,我們可以討論可能的解決方案。

排除頁面和以下不兼容:

WP CSS下拉菜單
Phantom主題 - 此主題

請求和錯誤報告

我僅在此註記請求和錯誤報告,我並沒有調查這些事項。

原文外掛簡介

This plugin adds a checkbox, “include this page in menus”, uncheck this to exclude pages from the page navigation that users see on your site.
Any issues: contact me.This plugin adds a checkbox, “include this page in menus”, which is checked by default. If you uncheck
it, the page will not appear in any listings of pages (which includes, and is usually limited to, your
page navigation menus).
Pages which are children of excluded pages also do not show up in menu listings. (An alert in the editing screen,
underneath the “include” checkbox allows you to track down which ancestor page is affecting child pages
in this way.)
Advanced Usage
It is possible to temporarily pause and resume the effect of Exclude Pages by using the new and templates tags. The following code will show a list of all pages in your site, even those normally hidden:

Pages

' ); ?>

You can also get an array the IDs of the pages which are excluded by calling the function ep_get_excluded_ids();, you can then use these IDs as you wish (e.g. feed them into raw MySQL queries).
Note to other plugin authors:
The plugin does not operate on wp_list_pages while the user is on an admin page, if this is an issue you can take advantage of the ep_admin_bail_out filter and create a filter function which returns false to allow Exclude Pages to operate in the admin area.
Another note:
If your plugins or themes don’t use the standard WordPress functions to create their menus then they won’t work. To get them to work you will need to track down the bit of code in the theme/plugin which gets the pages and change it to apply the filter “get_pages” (I cannot be responsible for any unforseen effects of the changes you make, so please test thoroughly). The change to getting pages will probably look something like this:
$pages = apply_filters( 'get_pages', $pages );

Please contact me if you’re completely stuck and we can discuss possible solutions.
Exclude pages is incompatible with:

WP CSS Dropdown Menus
Phantom theme – This theme

Requests & Bug Reports
I’m simply noting requests & bug reports here, I’ve not necessarily looked into any of these.
None!

各版本下載點

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

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


1.0 | 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | 1.9 | 1.51 | 1.91 | 1.92 | 1.8.1 | 1.8.2 | 1.8.3 | trunk |

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

  • Exclude Pages From Menu 》「從選單中排除頁面 (Exclude Pages From Menu)」外掛提供了一個簡單的選項,可讓您從導覽選單中移除任何頁面。, 該外掛在管理區的頁面編輯畫面中提供了一個...。
  • CleanCodeNZ Exclude Pages Plugin 》這個外掛可以讓你定義自訂欄位,將其附加到頁面並從導覽和(或)搜尋結果中排除。, 由於排除是通過高度優化的緩存通用 WordPress 查詢完成的,甚至對於階層數...。

文章
Filter
Apply Filters
Mastodon