[WordPress] 外掛分享: re.place

首頁外掛目錄 › re.place
⚠ 此外掛已下架 — 不再更新維護,建議勿安裝。
50+
安裝啟用
★★★★★
5/5 分(1 則評價)
5831 天前
最後更新
問題解決
WordPress 2.0.2+ v0.2.1 上架:2008-08-04

內容簡介

re.place 是一個模組,作為內容篩選器。「re.place」透過預先定義的正則表達式搜索並替換匹配的內容。

根據不同的「替換限制」,可以指定不同的替換,包括認證使用者和訪客、頁面和非頁面(參見「螢幕截圖」)。

例如,您可以實現跨連結模組的功能,同時添加插入「目標」參數、「rel = nofollow」、樣式信息等的可能性。

作為另一個例子,您可以在文章中插入自定義表情符號或類似內容。

作為另一個例子,您可以添加自定義標記到您的部落格中,如 Google(something) 會插入到www.google.com/search?q=something 的連結,TouTube (youtube_id) 將插入顯示該視頻的<object ...>,等等。請參見「其他說明」以獲取更多範例。

您可以將 HTTP 鏈接替換為其他東西,對於訪客而言,保留身份驗證的用戶(請參見 https://wordpress.org/support/topic/297405)。

每個條目都可以有自定義的「順序」號碼,因此可以鏈接替換內容。

re.place 將條目存儲在數據庫中。

提供管理GUI以列出條目,添加、編輯或刪除條目。

請參見更新日誌以獲取一些更改跟踪。

簡要範例

作為搜索字段,使用 ‘_—‘(在 _ 的位置上使用空格),
作為替換 — ‘#160;—‘。這將在每個 em-dash 的前面插入不間斷的空格。

如果您太喜歡印刷的話,您甚至可以使用 ‘<span style="letter-spacing:0.1ex;">#160;</span>—‘作為替換替換以插入更窄的不間斷的空格。您可以使句點之後的空間更寬…

搜索 ‘:-)‘,並替換為:

‘<img src="http://www.kolobok.us/smiles/standart/smile3.gif"' .
'alt=":-)" title=":-) (nice smile -- http://www.kolobok.us/smiles/standart/smile3.gif)"' .
'style="vertical-align: middle;" />‘

搜尋模式:YouTube\(([a-zA-Z_0-9\-]*)\)

替換模式:

‘<object width="425" height="344" data="http://www.youtube.com/v/\1" type="application/x-shockwave-flash">
<param name="movie" value="http://www.youtube.com/v/\1"></param>
</object>‘

這將允許您使用標記,如YouTube(TMCf7SNUb-Q)輕鬆插入Youtube視頻片段。

如何批量刪除連結 (在文章內停用 URL 連結的內容)? (https://wordpress.org/support/topic/288020)

搜尋模式:<a [^>]*>([^<]*)<\/a>

替換模式:\1

這將「停用」所有文章中的所有鏈接 (例如將<a href="...">嘗試!</a>替換為 嘗試!)。注意,您可以停用此re.place條目,並將其激活回去。

想輕鬆插入下拉字母嗎? 請在文章中使用‘<drop>L</drop>orem ipsum...‘,然後使用<span class="dropcap">\1</span>來替換它。使用角括號,如果您(意外地)停用了re.place,這些標籤也會在文章中出現

外掛標籤

開發者團隊

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

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

原文外掛簡介

re.place is a module wich acts as a content filter. It searches for pre-defined
regular expressions and replaces matches with pre-defined replacements.
It is possible to specify different replacements based on several
“replacement restrictions” — for authenticated users and guests,
for pages and non-pages currently (see “Screenshots”).
For example, you can implement the functionality of cross-linker module, while
adding the possibility to insert “target” parameter, “rel=nofollow”, style
information, etc.
As another example, you can insert in your posts custom smiles or the like.
As another example, you can add custom markup to you blog, like
Google(something) would insert link to www.google.com/search?q=something,
TouTube(youtube_id) will insert , wich displays that video,
etc-etc. See “Other notes” for more examples.
You can replace http links with some other stuff for guests, leaving as is for
authenticated users (see https://wordpress.org/support/topic/297405).
Every entry can have custom “order” number, so you can chain your replacements.
re.place stores entries in database.
Management GUI provided to list entries, add, edit or delete entries.
See changelog for some changes tracking.
A brief examples

As a search field, use ‘_—‘ (space in place of _!),
as a replace — ‘#160;—‘. This will insert non-breaking space
before every em-dash.
Mmm… You may wish even use ‘#160;—‘ as a replase to insert
narrower non-breaking space… If you love typography too much… And you
can make space after dot wider…

Search for ‘:-)‘ and replace with:

Search pattern: YouTube\(([a-zA-Z_0-9\-]*)\)
Replace pattern:

This will allow you to use markups like YouTube(TMCf7SNUb-Q) to insert
Youtube video fragments easily.

How to Mass Remove Link (mass deactivate URL Linked text inside posts)?
(https://wordpress.org/support/topic/288020)
Search pattern: ]*>([^<]*)<\/a>
Replace pattern: \1
This will “deactivate” all links in all posts
(e.g. replace
Try! with just Try!).
Note, you can activate them back, deactivating this re.place entry.

Want to insert drop caps easily?.. Use ‘Lorem ipsum...‘ in your
posts and replace it with \1‘. Use angle brackets,
and if you (accidentally) deactivate re.place, these “tags” won’t mess you page.

New — in v0.1.3 — [beta-] feature: you can specify different replace patterns
for authenticated users and “guests”. Sorry, i’ll update screenshots and doc
ASAP. 🙂

延伸相關外掛

文章
Filter
Apply Filters
Mastodon