[WordPress] 外掛分享: Codifigata – Content Login Gate

首頁外掛目錄 › Codifigata – Content Login Gate
WordPress 外掛 Codifigata – Content Login Gate 的封面圖片
全新外掛
安裝啟用
尚無評分
6 天前
最後更新
問題解決
WordPress 5.8+ PHP 7.4+ v1.3.0 上架:2026-07-23

內容簡介

Codifigata – Content Login Gate 讓您可以限制文章或頁面的全部內容或部分內容(例如下載按鈕)僅對已登入用戶可見,並在受限內容處顯示登入按鈕給未登入的訪客。

【主要功能】
• 限制整個內容或特定區域
• 兩種顯示模式:模糊或隱藏內容
• 自訂登入頁面 URL 和按鈕樣式
• 支援多種文章類型的自訂設置
• 立即啟用,無需寫程式碼

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Codifigata – Content Login Gate」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Codifigata – Content Login Gate lets you restrict the entire content of a post/page, or just part of it (for example download buttons), to logged-in users, showing a login button to logged-out visitors in place of the restricted content.
Two usage modes

Gate the entire content — enable it with a simple checkbox in the “Restricted access” meta box, shown in the editor sidebar for posts and pages.
Gate a specific area — using the [cdfg_login_gate]...[/cdfg_login_gate] shortcode, which can be added in the Gutenberg “Shortcode” block. Useful for hiding only one section of the content (e.g. download buttons) while keeping the rest of the post visible.

Two display modes (Settings → Content Login Gate)

Blur the content — the content stays in the page but is visually blurred via CSS, with an overlay and a login button. Effective as a preview/registration nudge, but it is not real protection: anyone who views the page source can still read the content.
Hide the content — the restricted content is not included in the HTML sent to logged-out users: only the login button appears on the page. Recommended for genuinely sensitive content (download links, private information, etc.).

Features

Works right after activation, with sensible defaults.
Settings page with a color picker to customize the button’s background color, text color, and label, without writing code.
CSS is only loaded on pages where the gate is actually active (no impact on pages without restricted content).
Customizable login page URL, with automatic redirect back to the original content after login.
Supported post types customizable via a PHP filter.
min_height and label shortcode attributes to customize each individual restricted area.

Developer filters
cdfg_login_url (string $login_url, string $redirect)

Filters the base URL of the login page. Default: home_url( '/login/' ).
cdfg_button_label (string $label)

Filters the default label of the login button.
cdfg_post_types (array $post_types)

Filters the list of post types on which the “Restricted access” meta box is shown. Default: array( 'post', 'page' ).
Example:
add_filter( 'cdfg_login_url', function( $url, $redirect ) {
return home_url( '/sign-in/' );
}, 10, 2 );

add_filter( 'cdfg_post_types', function( $post_types ) {
$post_types[] = 'product';
return $post_types;
} );

延伸相關外掛

文章
Filter
Apply Filters
Mastodon