內容簡介
wpSpoiler 是一個 WordPress 外掛,旨在保護讀者免受劇透的困擾,例如在書籍或電影評論中。
默認情況下,劇透文本是隱藏的,並且可以透過點擊才顯示。
要將文本標記為劇透,請在該段落前後加上 [spoiler] 和 [/spoiler] 標籤。
功能
非常快速,程式碼量小
可通過 CSS 自定義樣式
此頁面的德語版本位於此處。
本頁面的德語版本位於此處。
用法
要將文本標記為劇透,請在該段落前後加上 [spoiler] 和 [/spoiler] 標籤。
例如:
劇透:[spoiler]布魯斯·威利斯是鬼魂![/spoiler]
結果顯示在截圖區域。
自定義
鏈接文字的語言必須在外掛文件 wpSpoiler.php 中更改。
CSS 可用於設計劇透框和鏈接的樣式。劇透框由類名 spoiler_div 識別。
鏈接的類別是 spoiler_link_show 或 spoiler_link_hide,取決於當前狀態。
以下是一個樣式表程式碼片段的範例:
/* wpSpoiler */
a.spoiler_link_show,
a.spoiler_link_hide {
background-repeat: no-repeat;
background-position: left center;
padding-left: 18px;
}
a.spoiler_link_show {
background-image: url(images/add.png);
}
a.spoiler_link_hide {
background-image: url(images/delete.png);
}
div.spoiler_div {
background-color: #ddd;
margin-top: -10px;
padding: 2px;
}
外掛標籤
開發者團隊
原文外掛簡介
wpSpoiler is a plugin for WordPress, designed to protect the reader against spoilers, for example in book or filmreviews.
The spoiler text is hidden by default and shows up if wished.
To mark a text as spoiler, enclose the passage with [spoiler] and [/spoiler].
Features
Very fast, less code
Customizeable with CSS
A german version of this page can be found here.
Eine deutsche Version dieser Seite ist hier zu finden.
Usage
To mark a text as spoiler, enclose the passage with [spoiler] and [/spoiler].
Example:
Spoiler: [spoiler]Bruce Willis is a ghost![/spoiler]
The result is shown in the screenshot section.
Customize
The language of the link text has to be changed in the pluginfile itself: wpSpoiler.php.
CSS can be used to style the spoiler box and the links. The spoiler-div is identified by the classname spoiler_div.
The link’s class is spoiler_link_show or spoiler_link_hide, depending on the current state.
An example stylesheet code snippet:
/* wpSpoiler */
a.spoiler_link_show,
a.spoiler_link_hide {
background-repeat: no-repeat;
background-position: left center;
padding-left: 18px;
}
a.spoiler_link_show {
background-image: url(images/add.png);
}
a.spoiler_link_hide {
background-image: url(images/delete.png);
}
div.spoiler_div {
background-color: #ddd;
margin-top: -10px;
padding: 2px;
}
