[WordPress] 外掛分享: CFB Must Login

首頁外掛目錄 › CFB Must Login
全新外掛
安裝啟用
尚無評分
77 天前
最後更新
問題解決
WordPress 5.0+ PHP 7.4+ v1.0.0 上架:2025-12-30

內容簡介

**外掛總結:**
Must Login是一個輕量、用戶友好的外掛,讓您只需點擊一次就能要求整個網站的使用者登錄。非常適用於會員網站、私人部落格、內部網站,或任何需要限制只有註冊用戶才能訪問的網站。

**問題與答案:**
1. Must Login外掛的功能有哪些?
- 答案:
- 點擊一次切換功能:從管理工具欄中立即啟用或停用登錄要求。
- REST API保護:可配置REST API端點的鑑權需求。
- 自動清除緩存:在切換保護時自動清除常見的緩存外掛程式。
- 管理工具欄狀態指示燈:隨時一覽是否需要登錄。
- 簡易設置頁面:易於使用的設置界面。
- 管理員覆蓋:管理員始終可以訪問,即使需要登錄。
- 智能重新導向:用戶被重定向到登錄頁面,然後返回到原來的頁面。
- 選擇性端點訪問:允許特定REST API端點用於表單和鑑權。
- 緩存兼容:與WP Super Cache、W3 Total Cache、WP Rocket等外掛相容。
- 無需配置:開箱即用。
- 輕量級:對網站性能的影響很小。
- 支援翻譯:完全國際化,可直接進行翻譯。

2. 使用Must Login外掛的步驟是什麼?
- 答案:
- 安裝並啟用外掛。
- 點擊管理工具欄中的鎖形圖示以切換登錄要求。
- 完成!您的網站現在已受保護。

3. Must Login外掛是否支援開發者文件?
- 答案: 是的,外掛提供開發者文檔,包括關於過濾器、操作和功能的資訊。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「CFB Must Login」→ 直接安裝(推薦)

原文外掛簡介

Must Login is a lightweight, user-friendly plugin that allows you to require login for your entire site with just one click. Perfect for membership sites, private blogs, intranets, or any site that needs to restrict access to registered users only.
Features

One-Click Toggle – Enable or disable login requirement instantly from the admin bar
REST API Protection – Configurable authentication requirement for REST API endpoints
Automatic Cache Clearing – Automatically clears popular caching plugins when toggling protection
Admin Bar Status Indicator – Always see at a glance whether login is required
Simple Settings Page – Easy-to-use settings interface
Admin Override – Administrators always have access, even when login is required
Smart Redirects – Users are redirected to login and then back to their intended page
Selective Endpoint Access – Allow specific REST API endpoints for forms and authentication
Cache Compatibility – Works with WP Super Cache, W3 Total Cache, WP Rocket, and more
No Configuration Needed – Works perfectly out of the box
Lightweight – Minimal impact on site performance
Translation Ready – Fully internationalized and ready for translation

How It Works

Install and activate the plugin
Click the lock icon in the admin bar to toggle login requirement
That’s it! Your site is now protected

When enabled, all visitors must log in to view any page on your site. Administrators can quickly toggle this on or off from anywhere on the site using the admin bar.
Developer Documentation
Filters
cfb_must_login_redirect_url – Customize the login redirect URL
add_filter('cfb_must_login_redirect_url', function($redirect_url, $redirect_to) {
return 'https://example.com/custom-login';
}, 10, 2);

cfb_must_login_allowed_rest_routes – Allow additional REST API endpoints
add_filter('cfb_must_login_allowed_rest_routes', function($routes) {
$routes[] = '/my-plugin/v1/public';
return $routes;
});

Actions
cfb_must_login_clear_cache – Triggered when cache is cleared
add_action('cfb_must_login_clear_cache', function() {
// Custom cache clearing logic
});

Capabilities
The plugin uses the cfb_must_login_manage capability, which is mapped to manage_options by default. You can customize this using the map_meta_cap filter.

延伸相關外掛

文章
Filter
Mastodon