[WordPress] 外掛分享: Remove WordPress to WordPress filter

首頁外掛目錄 › Remove WordPress to WordPress filter
30+
安裝啟用
★★★★★
5/5 分(4 則評價)
1804 天前
最後更新
問題解決
WordPress 3.0+ v1.3 上架:2010-05-29

內容簡介

在 WordPress 3.0 及之後的版本中,預設篩濾器會將文章、標題和評論中所有的「WordPress」(注意小寫的「p」)更改為「WordPress」。 由於各種原因,例如保留現有文章和評論中的拼寫,部落格擁有者可能想要關閉這個篩濾器。這就是這個外掛的功能。

只需將外掛檔案上傳到 WordPress 外掛資料夾,在部落格的外掛管理頁面啟用它,就完成了!

技術細節

此外掛旨在禁用 capital_P_dangit 函數,這是 WordPress 的一個功能,禁止在部落格中使用「WordPress」一詞。

此篩濾器定義在 WordPress 核心程式碼的 wp-includes/default-filters.php 中,應用在 wp-includes/formatting.php 中。

這個外掛使用 remove_filter 函數撤銷 wp-includes/formatting.php 中應用的 add_filter 函數。在 1.0 和 1.1 版本中,該函數被移除了某些優先級。自 1.2 版本以來,此外掛刪除了所有可能的優先級的篩濾器。感謝Matt Robinson 建議此方法並提供外掛中使用的程式碼

有關此函數在 WordPress 中的應用程序的更多信息,以下是有關此函數的相關更改集:

針對 WordPress 3.0 的更改
針對 WordPress 3.0.1 的更改
針對 WordPress 3.1 的更改
針對 WordPress 3.5 的更改
針對 WordPress 3.7 的更改
針對 WordPress 3.8 的更改

外掛標籤

開發者團隊

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

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

原文外掛簡介

In WordPress 3.0 and later, a default filter changes all instances of “WordPress” (note the small “p”) in posts, titles, and comments to “WordPress”. For various reasons, such as preserving spelling in existing posts and comments, a blog owner may want to turn this filter off. That is what this plugin does.
Simply upload the plugin files to your WordPress plugins folder, activate it on your blog’s Plugin administration page, and you are set!
Technical Details
This plugin seeks to disable the capital_P_dangit function, which is the WordPress function that disallows “WordPress” to be used on blogs.
The filter is defined in wp-includes/default-filters.php and is applied in wp-includes/formatting.php of the core WordPress code.
The remove_filter function is used in this plugin to undo the add_filter function applied in wp-includes/formatting.php. In versions 1.0 and 1.1 of this plugin, the function was removed for certain priority levels. As of version 1.2, this plugin removes the filter for all possible priority levels. Thanks to Matt Robinson for suggesting this method and providing code that is used in the plugin.
For more information regarding how this function is applied in WordPress, the following are the relevant changesets to the core WordPress code regarding this function:

Changes made for WordPress 3.0
Changes made for WordPress 3.0.1
Changes made for WordPress 3.1
Changes made for WordPress 3.5
Changes made for WordPress 3.7
Changes made for WordPress 3.8

延伸相關外掛

文章
Filter
Apply Filters
Mastodon