[WordPress] 外掛分享: Lock Pages

前言介紹

  • 這款 WordPress 外掛「Lock Pages」是 2009-11-07 上架。
  • 目前有 500 個安裝啟用數。
  • 上一次更新是 2018-12-19,距離現在已有 2328 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

gyrus |

外掛標籤

cms | page | admin | pages | administration |

內容簡介

注意:此外掛並未與 Gutenberg 進行測試,且我們近期也沒有這方面的計畫。若您使用 WP > 5.0,若有問題請使用經典編輯器。

注意:此外掛最初是設計用於鎖定頁面,只有後來才新增自訂文章類別的功能。因此有時會使用「頁面」的術語,而其實指的是「任何文章類別」。

有些頁面或文章類別對於網站編輯員而言十分重要,因此不能讓他們隨意移動或刪除。編輯員可能沒有意識到移動頁面網址或刪除一個頁面後會對 SEO 造成什麼樣的影響。此外,某些頁面可能因為網站結構或自訂主題的相關因素而需要保持原地。

這個外掛讓管理員能夠「鎖定」任何或所有頁面,以及任何文章類別。這裡的「鎖定」基本上是指防止非管理員進行以下操作:

編輯文章網址
變更文章父級
變更文章佈景主題
刪除文章
變更文章狀態
變更文章的密碼保護

透過實際阻止資料庫更新以及在可能的情況下移除相應的介面元素,達到了鎖定的效果。在伺服器端透過 WP filters 移除介面元素,如果不行再採用 jQuery 在客戶端執行。

注意:目前我無法讓這個外掛與「快速編輯」功能搭配使用。為了先擋住,我把非編輯被鎖定頁面的使用者從「快速編輯」連結中移除。我知道,這不是很妥當。但在我找到如何有選擇地阻擋快速編輯之前,我假設一個鎖定的頁面就是鎖定的。使用者仍然可以透過正常編輯頁面編輯其他欄位。

請前往 GitHub 取得 開發程式碼和問題追蹤。

已知問題

「快速編輯」功能存在問題。我已經找到可以在「快速編輯」框中建立隱藏欄位、並將數值放入隱藏區塊中的方法,但我無法想到如何動態填充欄位數值,以便在保存時必要時使用舊數據。目前先封鎖不具有編輯鎖定頁面權限的使用者使用「快速編輯」。
雖然我已經修正了 lock_parent 函數,以便將已上傳的檔案附加到已鎖定的頁面上,但仍然無法在插入媒體時附加已在資料庫中的媒體。

想法

在「快速編輯」表單中為管理員增加鎖定核取方塊。
在設定頁面上,使用下拉式選單選擇已鎖定頁面元素所需的權限。
實作一個能夠處理後代的系統,例如選項選擇是否鎖定已鎖定頁面的所有後代。

原文外掛簡介

NOTE: This plugin is not tested with Gutenberg, and we have no near-term plans to do so. If using WP > 5.0, use the Classic Editor if there are problems.
NOTE: This plugin was originally designed to only lock pages, and only later added custom post type functionality. Hence the name, and sometimes the terminology will say “pages” when it means “any post type”.
Sometimes some pages or other posts are too important to allow them to be casually moved about or deleted by site editors. An editor may think nothing of renaming a page’s slug, or deleting a page to replace it with something similar, perhaps unaware of effects on SEO. Also, certain pages might be essential to keep in place because of a site’s structure, or because of aspects of a custom theme.
This plugin lets administrators “lock” any or all pages, and any post of any post type. “Locking” here basically means preventing non-admins from:

Editing the item’s slug
Changing the item’s parent
Changing the item’s template
Deleting the item
Changing the item’s status
Changing the item’s password protection

Locking is implemented by preventing the actual database update being performed as well as, where possible, having the interface element for that field removed. Where possible interface elements are removed via WP filters on the server; otherwise, jQuery is used on the client.
NOTE: Currently, I’ve been unable to get this working with the Quick Edit functionality. As a stop-gap measure, which is only in place because it seems to be better than nothing, the Quick Edit link is removed for users who can’t edit locked pages. I know, it’s not great. But until I work out how to selectively block Quick Editing, I’m assuming a locked page should be locked. Users can always edit the other fields via the normal edit page.
Go to GitHub for development code and issue tracking.
Known issues

Quick Edit presents problems. I’ve worked out how to create hidden fields in the Quick Edit box, and to put the values in the hidden div, but I can’t work out how to dynamically populate the fields with the values, so the old values can be used if necessary on saving. For now Quick Edit is blocked for users who can’t edit locked pages.
Although I’ve fixed the lock_parent function so it allows uploaded files to be attached to a locked page, it still prevents media already in the library from being attached when inserted.

Ideas

Include the locking checkbox for admins in the Quick Edit form.
On the settings screen, use a drop-down for selecting which capability is needed for editing locked page elements.
Implement a system to deal with descendants, e.g. an option to lock all descendants of a locked page or not.

各版本下載點

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

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


0.2 | 0.3 | 0.1.2 | 0.1.3 | 0.1.4 | 0.1.5 | 0.1.6 | 0.2.1 | 0.2.2 | 0.2.3 | 0.3.1 | trunk |

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

  • WP-PageNavi 》想要取代舊的 ← Older posts | Newer posts → 連結,並改為一些頁面連結嗎?, 這個外掛提供了 wp_pagenavi() 的樣板標籤,可以產生豪華的分頁連結...。
  • Nested Pages 》Nested Pages 是什麼?, , , 提供直覺且易於操作的拖放介面,以管理網頁結構及文章排序, 增強了快速編輯功能, 新增可編輯、可排序的樹狀表示網站頁面結構, 會...。
  • Display Posts – Easy lists, grids, navigation, and more 》Display Posts 讓您輕鬆地列出網站上的所有內容。首先在內容編輯器中新增此短碼,以列出最近的文章清單:, [display-posts], , 按類別篩選, 若只想顯示特定類...。
  • CMS Tree Page View 》將所有頁面和自訂文章以 CMS 樹狀概覽方式添加到 WordPress,類似於專注於頁面的 CMS 中經常找到的檢視方式。, 如果您的目標是將多個內容類型合併到單一檢視...。
  • Insert Pages 》Insert Pages 可讓您使用 Shortcode API,將任何 WordPress 內容(例如,頁面、文章、自訂文章類型)嵌入其他 WordPress 內容。它還包括一個小工具,可將頁面...。
  • Widgets on Pages 》這是添加小工具到文章和/或頁面最簡單,也是評價最高的方法。您可以創建無限的動態側邊欄(小工具區域),把它們插入到 WordPress 文章或頁面中。, 從設置菜...。
  • Post Tags and Categories for Pages 》將文章標籤與分類套件套用於所有頁面,讓您可以使用 WordPress 原生的分類功能來分類您的頁面,並且會顯示在 WordPress 存檔查詢裡。, 這個外掛並不會自動顯...。
  • My Private Site 》本外掛可讓管理員將 WordPress 網站限制僅供已註冊且已登入的使用者查看,任何未登入的使用者試圖查看網站上的任何頁面、文章或其他部分,都會顯示 WordPress...。
  • WP PageNavi Style 》首先,我想感謝 Lester 'GaMerZ' Chan 和 scribu 為這個美麗的 WordPress 頁面導航外掛所做出的貢獻。, 使用此外掛你必須先安裝 Wp Pagenavi。 , 連結:分頁...。
  • Tag Pages 》此外掛讓你可以像處理文章一樣新增標籤至頁面。, 此外掛將 ‘post_tag’ 分類法加入頁面文章類型中。, 這樣就可以在新增或編輯頁面介面中顯示標籤...。
  • Posts in Page 》使用簡單的簡碼 (shortcodes),輕鬆地將一個或多個文章添加到任何頁面。, 支援類別 (categories)、標籤 (tags)、自訂文章類型 (custom post types)、自訂稅項...。
  • Page Restrict 》限制某些頁面或文章僅限登錄用戶訪問, 此外掛允許您將所有頁面/文章限制為僅限登錄用戶訪問、不限制或選擇性限制。, 在某些情況下,您可能會將 WordPress 用...。
  • No Page Comment 》直到最近,WordPress 提供兩種選擇:你可以默認禁用所有頁面和文章的評論和引用追蹤,或者你可以啟用它們。在WordPress 4.3 版本中,這種情況終於改變,所以...。
  • HTML Page Sitemap 》此簡單外掛可透過輸入簡短代碼 [html_sitemap]於網頁內容中,新增一個頁面的 HTML 網站地圖(非 XML),但不包含文章。此外掛可設定特定深度、從特定父頁面開始...。
  • Essential Widgets 》Essential Widgets 是一款免費的 WordPress 插件,專門用於小工具,可以讓您在網站上創建和添加有趣的小工具,使其更具吸引力和親和力。Essential Widgets 忠...。

文章
Filter
Apply Filters
Mastodon