[WordPress] 外掛分享: Login to read more

首頁外掛目錄 › Login to read more
WordPress 外掛 Login to read more 的封面圖片
30+
安裝啟用
★★★★★
5/5 分(1 則評價)
4646 天前
最後更新
問題解決
WordPress 3.5+ v0.2.0 上架:2013-06-25

內容簡介

顯示由簡碼包圍的內容,僅限註冊用戶使用。

[auth]此內容僅顯示給註冊用戶[/auth]

https://github.com/miya0001/login-to-read-more

參數

class – CSS 的類名。預設值為「btn btn-primary btn-large」
href – 按鈕的連結網址。預設值為您網站的登錄網址。
text – 按鈕的文字。預設值為「登入以閱讀更多」

以下將以參數來新增類別。

範例: [auth class="foo"]
輸出: <a class="foo" ...>...</a>

以下將改變連結的 URL。

範例: [auth href="http://example.com/xxx/"]
輸出: <a href="http://example.com/xxx/" ...>...</a>

以下將改變文字。

範例: [auth text="加入"]
輸出: <a ...>加入</a>

Filter Hook

login_to_read_more_class – 變更預設的類別。
login_to_read_more_href – 變更預設的網址。
login_to_read_more_text – 變更預設的文字。

以下是使用「login_to_read_more_text」篩選器的範例。

add_filter('login_to_read_more_text', 'my_login_to_read_more_text');
function my_login_to_read_more_text(){
return '加入';
}

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.2.0) 或搜尋安裝

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

原文外掛簡介

Display content enclosed by the shortcode for registered users only.
[auth]This content will display for registered users only[/auth]

https://github.com/miya0001/login-to-read-more
Arguments

class – Class name for css. default value is “btn btn-primary btn-large”
href – Link URL for button. default value is login url for your site
text – Button text. default value is “Login to read more”

The following will add a class as argument.
Example: [auth class="foo"]
Output: ...

The following will change url link.
Example: [auth href="http://example.com/xxx/"]
Output: ...

The following will change text.
Example: [auth text="Join"]
Output: Join

Filter Hook

login_to_read_more_class – Change default class.
login_to_read_more_href – Change default url.
login_to_read_more_text – Change default text.

The following is example for “login_to_read_more_text” filter.
add_filter('login_to_read_more_text', 'my_login_to_read_more_text');
function my_login_to_read_more_text(){
return 'Join';
}

延伸相關外掛

文章
Filter
Mastodon