[WordPress] 外掛分享: Text Filter Suite

前言介紹

  • 這款 WordPress 外掛「Text Filter Suite」是 2004-12-09 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2015-06-03,距離現在已有 3623 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 1.5 以上版本才可以安裝。
  • 有 2 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

dougal |

外掛標籤

fun | funny | content | filters | comments |

內容簡介

文字過濾套件(以下簡稱TFS)是一個 WordPress 外掛程式,
可以加入一些新的文字過濾功能。從某種意義上來說,TFS 的核心
功能可以被視為一個"元過濾器",因為它們實際上提供了一個框架,
讓你輕鬆地構建新的過濾器。此外,它們還提供了一種簡單的方式,
可以按照每篇文章的不同需求,對文章內容和評論進行過濾。

嗯? 你能用通俗易懂的語言講一遍嗎?

好的,我們來舉個例子。在很多網站上,常見的一個功能就是對縮寫字的自動處理。
你經常會看到像"XHTML"這樣的縮寫以不同的樣式顯示,當你將鼠標指向它時,
會彈出一個提示工具,顯示它的定義(例如"擴展超文本標記語言")。
你不想每次發佈內容都要輸入這些標記,因此就有了多個可以處理這種自動文字替換功能的外掛。

TFS 自帶"TFS Acronymit"插件來執行此功能。它基於 Matt Mullenweg 的原始"Acronymit"功能,
但是有些改進。在 Matt 的原始功能中,你必須將縮寫列表按最長到最短排序,
並且它可能會對"PHP"("PHP Hypertext Processor")或 GNU("GNU's Not Unix")這樣的循環縮寫感到困惑。
而 TFS Acronymit 則沒有這些限制。

對於那些認為技術縮寫展開是"teh sux0r"(即"無聊")的人,TFS 還提供了多種更有趣的過濾器。
目前的設置包括"chef"、"fudd"、"jive"、"kraut"、"pirate"和上述提到的"acronymit"。
需要警告的是,"jive"和"kraut"過濾器並不是你所謂的"政治正確"。

默認情況下,如果啟用了"TFS Pirate"過濾器,它會自動應用到 Talk Like a Pirate Day(9 月 19 日)的所有內容中。
如果你不想自動啟用此過濾器,請在插件源碼的頂部設置"$talk_like_a_pirate"變數的值為"false"。

只要啟用了"TFS Acronymit"過濾器,它就會自動應用到所有文章的內容上。你不需要設置特殊的文章自定義字段即可使用它。
如果要修改定義的縮寫,請參見插件開始的列表,按照你看到的格式進行修改即可。

你可以在不啟用任何其他插件的情況下使用 TFS 核心功能。你可以使用內建的 PHP 函數接受一個字符串作為參數,並返回一個字符串。
例如,你可以設置一個文章自定義的"content_filter",其值為"strrev",那麼文章的內容就會倒過來顯示;或者使用"strtoupper"的值將內容轉換為全大寫文字。

每個文章自定義字段中只能指定一個功能。但是,你可以通過多次使用相同的鍵來鏈接多個函數。
例如,如果你想讓文章的所有評論顯示為大寫"Elmer Fudd",那麼可以使用"strtoupper"過濾器多次調用該鍵。

原文外掛簡介

The Text Filter Suite (“TFS”, hereafter) is a WordPress plugin which
adds some new text filtering functions. In a sense, the core TFS
functions could be considered a “meta filter”, because they actually
provide a framework that let you construct new filters fairly easily.
They also provide an easy way to apply filters to post content and
comments on a per-post basis.
Huh? Can you repeat that in English?
Okay, let’s try a real-world example. A common feature on many web
sites is the automatic handling of acronyms. You’ll often see an
acronym such as “XHTML” displayed in an alternate style, and when you
hover your mouse pointer over it, you get a tool-tip which displays the
definition (“eXtended HyperText Markup Language”, in this case). You
don’t want to have to type in the markup for this every time you post
something, and automation is what computers are for, right? So, there
are several plugins available to handle this sort of automated text
subsitution.
TFS comes with the “TFS Acronymit” plugin to perform this function.
It’s based on Matt Mullenweg’s original “Acronymit” function, but with
a couple of improvements. In Matt’s original function, you had to keep
the acronym list sorted, longest-to-shortest, and it could get confused
by recursive acronyms like ‘PHP’ (“PHP Hyptertext Processor”) or GNU
(“GNU’s Not Unix”). TFS Acronymit does not have those restrictions.
For those who think that expansion of technical acronyms is “teh sux0r”
(i.e. “boring”), TFS comes with a variety of more entertaining filters.
The current set includes “chef”, “fudd”, “jive”, “kraut”, “pirate”, and
of course, the aforementioned “acronymit”. As a word of caution, the
“jive” and “kraut” filters are not what you would call “politically
correct”.
By default, if the “TFS Pirate” filter is active, it will automatically
apply itself to all content on Talk Like a Pirate Day (September 19).
If you do not want this filter to automatically activate, set the value
of the “$talk_like_a_pirate” variable at the top of the plugin source
to “false”.
The “TFS Acronymit” filter is automatically applied to all posts
whenever it is active. You do not need to set special post custom
fields in order to use it. Just activate the plugin, and you’re ready.
To modify which acronyms are defined, see the list at the beginning of
the plugin, and modify it as you like, following the format you see
there.
It is possible to use the TFS core without activating any additional
plugins. You can do this with any built-in PHP function accepts a
single string as a parameter and returns a string. For example, you
could set a post custom “content_filter” with the value “strrev”, and
the contents of the post would be displayed backwards, or with a value
of “strtoupper” to convert the content to all uppercase text.
You can only specify a single function in each post custom field.
However, you can chain multiple functions together by using the key
more than once. For instance, if you wanted all comments for a post to
display in uppercase Elmer Fudd text, you would set two post custom
fields:
comment_filter = strtoupper
comment_filter = fudd
HOWEVER, note that using PHP built-in functions in this way will bypass
the power of the filter_cdata_content() function, which means that it
can and will mangle your HTML tags, possibly rendering them useless.
For example, applying the strrev function to the string “
” will
transform it into “>p

各版本下載點

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

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


1.0 | 1.2 | 1.3 | 1.4 | trunk |

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

  • Funny fruits 》這是一個簡單的遊戲,你有90秒的時間盡可能得分。只需在文章或頁面中輸入 [funnyfruits] 短代碼。。
  • WP Pranks 》這是個好玩的外掛,有許多選項可以拿來惡作劇你的朋友。不論你的 WordPress 網站使用什麼主題、外掛或版本,這個外掛都能百分之百的正常運行。, 以下為惡作劇...。
  • Travel Game – Vacation Widget 》這款遊戲是由 Ideal-Escapes.com 團隊開發的。我們開發了這款假期遊戲,旨在幫助熱愛旅行的人獲得驚人、新穎且有時瘋狂的旅行意念,給他們的伴侶留下深刻印象...。
  • The Daily Dilbert 》此外掛會在「側邊欄佈局頁面」新增一個「每日 Dilbert 漫畫」小工具,您可以像一般方式一樣直接把它拖曳到側邊欄中即可放置在您的部落格上。點選選項按鈕可以...。
  • Quote of The Day by TellmeQuotes 》這個外掛讓你可以在 WordPress 頁面上加上「每日一句名言」小工具。只需要放上這個小工具,每天都會自動顯示著名名人引用的家庭友善名言!, 我們的資料庫提供...。
  • My Hello Dolly 》這款外掛讓你可以在管理介面的右上方自訂歌詞、引言或任何文字,就像 Hello Dolly 外掛一樣。每個頁面都會顯示這些文字。, 回饋 My Hello Dolly。。
  • Lyrics by Eminem 》這是一個有趣的 WordPress 外掛程式,它會顯示 Eminem 的歌曲「My name is」的歌詞。類似於流行的「Hello Dolly」外掛程式,但它演繹的是 Slim Shady 的風格...。
  • Joke of the Day Advanced 》在您的 WordPress 博客上放置「今日笑話」小工具。此外採用了 ajax 技術從網絡笑話數據庫加載笑話,因此不會因為加載笑話而降低網頁速度。該外掛具有以下功能...。
  • Joke of the Day 》「每日笑話」外掛可在您的部落格上顯示分類的笑話。現有超過 40,000 個類別共分類,笑話保存在我們的數據庫中,因此您無需為所有信息腾出空间。。
  • Get Snarky 》這是原始的「Hello Dolly」外掛的分支/修改版。不過,我用隨機有趣的引文(主要來自 Twitter)代替了那些引言。這並沒有什麼大不了的,但仍然很有趣。請注意...。
  • Air Horn 》這個外掛會在您登入時播放空氣喇叭聲,並在 WordPress 工具列中新增一個空氣喇叭按鈕。, 使用方法:, 登入並聆聽空氣喇叭聲!。
  • WP Fun 》, , 這是一個有趣的屁聲外掛程式,可以供 WordPress 網站使用。, , , 查看示範 », , , 如果您喜歡這個外掛,歡迎追蹤我們的Twitter », , , 外掛...。
  • StrangeButFunnys Random Funny Picture 》這個外掛可以在網站上隨機顯示來自strangebutfunny.net的有趣圖片,詳細使用方式請參閱選項,請參考http://anthony.strangebutfunny.net/my-plugins/sbf_rand...。
  • Sk XKCD Widget 》這個外掛會在小工具中展示最新的 XKCD 圖片。它需要 PHP 5.0,並且啟用了 curl 和 dom 功能,這些功能在大多數主機中都已包含。XKCD 圖片是根據創意共用授權...。
  • Ron Swanson Quotes 》作為開發者,當我們管理客戶的 WordPress 站點時,我們需要定期享受幽默感。Ron Swanson Quotes 插件希望今天能給你一些。源代碼 API 由 jamesseanwright 創...。

文章
Filter
Apply Filters
Mastodon