[WordPress] 外掛分享: HTML Special Characters Helper

WordPress 外掛 HTML Special Characters Helper 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「HTML Special Characters Helper」是 2009-07-14 上架。
  • 目前有 200 個安裝啟用數。
  • 上一次更新是 2017-02-22,距離現在已有 2993 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.6 以上版本才可以安裝。
  • 有 3 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

coffee2code |

外掛標籤

dbx | post | write post | admin widget | html special characters |

內容簡介

在管理後台的新增/編輯文章以及新增/編輯頁面中,新增一個名稱為「HTML Special Characters」的小工具。當在小工具中點擊任何特殊字符時,該字符的編碼會被插入到文章正文文本框的當前光標位置(如果光標未在正文文本框中,則插入到文章末尾)。當在小工具中將滑鼠懸停在任何特殊字符上時,懸停文本會顯示該字符的 HTML 實體編碼以及該字符的名稱。

需要注意的是,在所謂的「可視化編輯器模式」中,該特殊字符本身會被添加到文章正文中。而且,對於依賴該模式的使用者來說,在該編輯器的進階工具欄中可以獲得自己的特殊字符彈出助手,這可能使該外掛對他們來說是不必要的。實際上,該外掛更適合用在「非可視化的 HTML 模式」中,因為這是插件作者本人的使用習慣。

連結:外掛官網 | WordPress 外掛目錄頁面 | 作者網站

過濾器

外掛提供了兩個過濾器,可供使用者鉤住。一般來說,使用過濾器的程式碼應該理想地放在一個 mu-plugin 或適用於特定網站的 plugin 中(這超出了此自述文件所能解釋的範圍)。

c2c_html_special_characters(過濾器)

「c2c_html_special_characters」這個觸發點可以讓您刪除現有的字符或整個字符組,以及/或添加新的字符或字符組。

引數:

$codes(array):一個關聯數組,其中鍵是分組名稱,而值是關聯數組本身,其中代碼作為鍵,人性化描述作為值。

例子:

/**
* 添加一個新字符組(帶有重音的“A”).
*
* @param array $characters 默認HTML特殊字符。
* @return array
*/
function more_html_special_characters( $characters ) {
$characters['accented_a'] = array(
'name' => 'Accented A',
'À' => 'A grave accent',
'Á' => 'A accute accent',
'Â' => 'A circumflex',
'Ã' => 'A tilde',
'Ä' => 'A umlaut',
'Å' => 'A ring',
'Æ' => 'AE ligature',
);
return $characters; // 重要!
}
add_filter( 'c2c_html_special_characters', 'more_html_special_characters' );

c2c_html_special_characters_post_type(過濾器)

「c2c_html_special_characters_post_type」這個觸發點可以讓您指定哪些文章類型需要在 HTML Special Characters 設置中顯示鉤子。

引數:

$post_types(array):一個包含文章類型的數組。默認情況下,此值為array( 'page', 'post' )

例子:

/**
* 在其他文章類型中顯示 HTML Special Characters 幫助程式.
*
* @param array $post_types 文章類型數組。
* @return array
*/
function more_html_special_characters_post_types( $post_types ) {
$post_types[] = 'products'; // 產品頁面中顯示
unset( $post_types['page'] ); // 不顯示在頁面中
return $post_types;
}
add_filter( 'c2c_html_special_characters_post_types', 'more_html_special_characters_post_types' );

原文外掛簡介

Add an admin widget labeled “HTML Special Characters” that is present in the admin Add/Edit Post and Add/Edit Page pages. Clicking on any special character in the widget causes its character encoding to be inserted into the post body text field at the current cursor location (or at the end of the post if the cursor isn’t located in the post body field). Hovering over any of the special characters in the admin widget causes hover text to appear that shows the HTML entity encoding for the character as well as the name of the character.
Note that when used in the visual editor mode the special character itself is added to the post body. Also note that the visual editor has its own special characters popup helper accessible via the advanced toolbar, which depending on your usage, may make this plugin unnecessary for you. In truth, the plugin is intended more for the non-visual (aka HTML) mode as that is the mode I (the plugin author) use.
Links: Plugin Homepage | Plugin Directory Page | Author Homepage
Filters
The plugin exposes two filters for hooking. Typically, code making use of filters should ideally be put into a mu-plugin or site-specific plugin (which is beyond the scope of this readme to explain).
c2c_html_special_characters (filter)
The ‘c2c_html_special_characters’ hook allows you to remove existing characters or entire groups of characters, and/or add new characters or groups of characters.
Arguments:

$codes (array) : An association array in which the keys are a grouping name and the values are associative arrays themselves with the code as the key and the human-friendly descriptions as the values.

Example:
/**
* Add a new grouping of characters (accented 'A's).
*
* @param array $characters Default HTML special characters.
* @return array
*/
function more_html_special_characters( $characters ) {
$characters['accented_a'] = array(
'name' => 'Accented A',
'À' => 'A grave accent',
'Á' => 'A accute accent',
'Â' => 'A circumflex',
'Ã' => 'A tilde',
'Ä' => 'A umlaut',
'Å' => 'A ring',
'Æ' => 'AE ligature',
);
return $characters; // Important!
}
add_filter( 'c2c_html_special_characters', 'more_html_special_characters' );

c2c_html_special_characters_post_type (filter)
The ‘c2c_html_special_characters_post_type’ hook allows you to specify which post_types for which the HTML Special Characters metabox should be shown.
Arguments:

$post_types (array) : An array of post types. By default, this value is array( 'page', 'post' )

Example:
/**
* Show HTML Special Characters Helper for additional post_types.
*
* @param array $post_types Arry of post types.
* @return array
*/
function more_html_special_characters_post_types( $post_types ) {
$post_types[] = 'products'; // Show for products
unset( $post_types['page'] ); // Don't show for pages
return $post_types;
}
add_filter( 'c2c_html_special_characters_post_types', 'more_html_special_characters_post_types' );

各版本下載點

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

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


1.0 | 1.5 | 1.6 | 1.7 | 1.8 | 1.9 | 2.0 | 2.1 | 2.2 | 2.3 | 1.7.1 | 1.9.1 | 1.9.2 | 1.9.3 | 2.0.1 | trunk |

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

  • PS Auto Sitemap 》PS Auto Sitemap 是一個 WordPress 外掛,自動從您的 WordPress 網站生成網站地圖頁面。, 對於初學者來說,安裝非常容易;對於專家來說,定制也非常容易。您...。
  • Post Type Switcher 》這個外掛在文章編輯介面中新增了一個簡單的文章型別下拉選單,讓你可以重新指派任何文章至新的文章型別。你可以在編輯文章時更換文章的型別。, 支援的型別, ...。
  • Post Duplicator 》這個外掛是用來製作選定文章的完全一模一樣複製。它支援自訂文章類型、自訂分類和自訂欄位。, *注意: 評論不會被複製到新文章。, 這個外掛的目的是為了快速且...。
  • Optimize Database after Deleting Revisions 》這個外掛是一個「一鍵式」WordPress資料庫清理/優化器。, 主要功能, , 刪除文章、頁面和/或自訂文章類型的修訂版本(您可以選擇保留最近的「X」個修訂版本,...。
  • Advanced Excerpt 》這個外掛可以改進 WordPress 原有的摘錄文章功能。, , 保留摘錄中的 HTML 標記,並可自選需要保留的標記, 按字元數或字數截斷摘錄, 只計算「真正的」文字(HT...。
  • Add From Server 》這個外掛提供有限的支援。請不要期望有太多新功能或修正 bug。功能可能隨時被移除。, Add From Server 外掛旨在幫助緩解不好的網站主機所造成的困擾,讓您可...。
  • Page and Post Clone 》這個外掛可以透過一個按鈕來複製貼文或頁面,現在您不必從零開始進行新頁面或貼文的樣式設計。, 這個外掛的主要功能包括:, , 建立一個頁面複本,保留所有內...。
  • WP Page Widget 》這款外掛讓小工具的選擇變得更加容易。啟用此外掛後,我們可以選擇要顯示在特定頁面/文章/自訂文章類型中的小工具。, 請注意,使用此外掛時必須啟用側邊欄主題。。
  • WP Total Hacks 》WP Total Hacks 可以在您的 WordPress 網站上自訂超過 20 個設置。, 此外掛已在 GitHub 上發布。, 一些功能:, 您可以選擇啟用或停用所有項目。, 需要 PHP5!...。
  • Revision Control 》**本外掛不提供支援。仍可使用,但請勿期待得到支援要求的回應或對「這無法運作」進行回應。**, Revision Control 是 WordPress 的一款外掛,可以讓使用者更...。
  • Reveal IDs 》WordPress 2.5版本發佈後,所有管理頁面的ID都被刪除了。這應該是因為普通用戶不需要它們。但對於高級WordPress用戶和開發人員來說,這些ID對某些外掛或模板...。
  • Bulk Delete 》Bulk Delete 是一個 WordPress 外掛,可以根據不同的條件和過濾器批次刪除文章、頁面、附件、使用者和元資料。此外掛支援以下條件和過濾器:, , 刪除文章, , ...。
  • WP Admin UI Customize 》, 儀表板, 顯示選項標籤, 輸出 - 元網站, 管理工具列 (Toolbar), 側邊選單 (Side menu), 元箱的管理, 登入畫面, 其他功能, , 這些自訂化都是可以實現的。, , ...。
  • Themify Portfolio Post 》Themify Portfolio Posts 是一個簡單的外掛,允許您展示乾淨版面的專案資訊。簡約而精美,您可以點擊您的圖庫專案的每張圖片,選擇顯示更多細節,例如專案類...。
  • Essential Content Types 》Essential Content Types 是一個 WordPress 外掛程式,讓您可以在您的網站上以不同的內容/文章類型展示出優秀的內容。這些內容/文章類型可能會被 WordPress ...。

文章
Filter
Apply Filters
Mastodon