前言介紹
- 這款 WordPress 外掛「Remove CapsLock」是 2021-09-05 上架。
- 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
- 上一次更新是 2021-09-10,距離現在已有 1332 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
text | capslock | lowercase | uppercase |
內容簡介
這個外掛會自動篩選標題、內容和評論中的大寫字母,並進行修正。
你可以自訂每種內容 (標題、內容、評論) 出現多少連續的大寫字母才觸發正常化處理。
這個外掛旨在在不影響 WordPress 資料庫內容的情況下即時改變顯示的文字!如果你想永久變更網站的內容或標題,你必須修改該文章。
請在安裝之前確定沒有 CSS 樣式會強制顯示大寫字母,否則字體的大小寫會受到 CSS 引導,而此外掛將會無效。如果外掛似乎無法使用,可以參考疑難排解章節進行解決。
安裝設定
安裝後,外掛會自動顯示正常化的文字。因此,標題、文章內容、小工具標題和評論會預設被篩選和正常化。
你可以在 functions.php 中自訂/添加/刪除過濾器,並提供 hook 名稱與允許的連續大寫字母數量。
1) 創建自己的 hook+rule
add_action( 'init', function() {
add_filter( 'rcl_hook_filters', function () { return array(
array( 'hook' => 'the_title', 'allowed_chars' => 6 ), // 標題
array( 'hook' => 'comment_text', 'allowed_chars' => 5 ), // 評論
array( 'hook' => 'widget_title', 'allowed_chars' => 6 ), // 小工具
);
} );
} );
2) 編輯單一過濾器數值 (並不會創建新的過濾器,只修改已經存在的過濾器數值)。如果要停用過濾器,但繼續使用標準設置的其餘過濾器,你需要將數值設置為“-1” (請見下面範例)。
add_filter( 'rcl_the_title', function () { return 60; } );
add_filter( 'rcl_comment_text', function () { return 3; } );
add_filter( 'rcl_widget_title', function () { return -1; } ); // 停用
最後提示一句,因為主要的文章/頁面內容類型不同 (並非字串),所以你需要如下設置文章內容的過濾器。
add_filter( 'rcl_the_content', function () { return 10; } );
// 或停用文章內容過濾器
// add_filter( 'rcl_the_content', function () { return -1; } );
如果你需要改變預設設置,只在評論中啟用大寫字母修正功能,你需要在 functions.php 中添加以下過濾器:
// functions.php
add_filter( 'rcl_the_content', function () { return -1; } ); // 停用
add_action( 'init', function() {
add_filter( 'rcl_hook_filters', function () { return array(
array( 'hook' => 'comment_text', 'allowed_chars' => 5 ), // 如果有兩個或更多大寫字母,就觸發文字正常化
);
} );
} );
疑難排解
該外掛不會改變你網站的 CSS 樣式,因為你可以從自訂器中輕鬆地進行設計並且不需要使用外掛。
因此,在安裝此外掛之前,建議你嘗試重置標題、內容和小工具的樣式,使用屬性 text-transform: inherit !important;。
版權
Remove CapsLock,版權所有 2021,Codekraft Studio
Remove CapsLock 釋出 GNU GPL 授權。
這是一個自由軟體,你可以重新散佈或修改它
依照自由軟體基金會 GNU 通用公共授權條款的規定,
不論版本 3 或任何之後版本,你都可以自由取得和使用它。
此程式是基於希望它有用的眾多動機之下發行的,
但是,沒有任何保證,甚至就一般適用性的保證都沒有。
更多詳細的資料,請參閱 GNU 通用公共授權條款。
原文外掛簡介
This plugin automatically filters titles, content and comments, searching and normalizing uppercase text.
You can customize the minimum amount of consecutive characters for each type of content (title, content, comments) before trigger the normalization function on that string.
This plugin is intended to change on-the-fly what is displayed without affecting what is stored in the wordpress database! If you want to change permanently the website content/titles you need to modify posts.
Please before install, be sure there isn’t any CSS rule that force uppercase otherwise the font case will be css driven and this plugin consequently useless. Check the troubleshooting section for guidance on this if the plugin seems not to work.
Setup
After installation, the plugin automatically displays normalised texts. So the title, post content, widget titles and comments will be filtered and normalised by default.
You can customize/add/remove filters adding to functions.php the name of the hook and the number of allowed consecutive uppercase characters.
1) To create your own set of hook+rule
add_action( 'init', function() {
add_filter( 'rcl_hook_filters', function () { return array(
array( 'hook' => 'the_title', 'allowed_chars' => 6 ), // title
array( 'hook' => 'comment_text', 'allowed_chars' => 5 ), // comments
array( 'hook' => 'widget_title', 'allowed_chars' => 6 ), // widget
);
} );
} );
2) To edit a single filter value (it doesn’t create any new filter, only change an already created one). In order to disable a filter, while continue to use the rest of the standard set, you need to set “-1” as value (example below).
add_filter( 'rcl_the_title', function () { return 60; } );
add_filter( 'rcl_comment_text', function () { return 3; } );
add_filter( 'rcl_widget_title', function () { return -1; } ); // disabled
One last note, since the main post/page content has a different content type (isn’t a string) you need to set the filter for the post content as below.
add_filter( 'rcl_the_content', function () { return 10; } );
// OR to disable the content filter
// add_filter( 'rcl_the_content', function () { return -1; } );
If you need to change the default setup and enable uppercase text correction ONLY for comments, you need to add to functions.php the filter as below:
// functions.php
add_filter( 'rcl_the_content', function () { return -1; } ); // disabled
add_action( 'init', function() {
add_filter( 'rcl_hook_filters', function () { return array(
array( 'hook' => 'comment_text', 'allowed_chars' => 5 ), // 2 or more uppercase digits triggers the text normalization
);
} );
} );
Troubleshooting
This plugin is not intended to change the css style of your website, because you can do this easily with customizer and without any plugin.
So before installing this plugin I suggest you try to reset the style of the title/content/widget, using the property text-transform: inherit !important;
copyright
Remove CapsLock, Copyright 2021 Codekraft Studio
Remove CapsLock is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the LICENSE file for more details.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Remove CapsLock」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
String locator 》當你在開發主題和外掛時,你經常會注意到某些文字被硬編碼在文件中,你需要對其進行修改,但你不知道該主題或外掛的名稱,更不知道要查找哪個文件。, 你可以...。
Enhanced Text Widget 》在您的免費假網站上試試吧:點擊此處 => https://tastewp.com/plugins/enhanced-text-widget (這個技巧可用於 WP 庫中的所有外掛,只需將 URL 中的「word...。
Texty – SMS Notification for WordPress, WooCommerce, Dokan and more 》Texty是一個輕量級的WordPress簡訊通知外掛程式。, , 隨著您收件匣收到眾多電子郵件,往往會讓最重要的事情掉到後頭。在手機、WhatsApp或Telegram收到簡訊通...。
Randomize 》Randomize 外掛可以顯示隨機的文字,您可以在管理後台按類別輸入文字、引文和 HTML 代碼。您可以使用小工具、shortcode 或模板標籤顯示網站上的隨機內容。, ...。
Custom Shortcodes 》使用插入短碼 [custom name=”field-name” value=”field-value“] 或 HTML 條件注釋
Advanced Text Widget 》Advanced Text Widget 是一個文字小工具,允許您執行原始 PHP 代碼,並指定它在哪些頁面上顯示。它有 10 種預設的可見條件。您也可以編輯和/或添加自己的可見...。
Text Replace 》這個外掛讓你輕鬆地定義出應用於文章中的文字或 HTML,以替代實際出現在文章中的字詞或片語。這是一個方便的技巧,可用於創建常見、冗長或經常更改的文本/HTM...。
WP Typograph Lite 》這個外掛WP Typograph Lite適用於大多數俄語博客,旨在根據俄語印刷標準自動格式化文本。它處理所有主要內容塊-標題、文章和頁面文本、評論。格式化是在頁面...。
Random Text 》RandomText 是一個方便的 WordPress 外掛,可以讓你保存、編輯和刪除分類文本,並通過小工具將隨機/旋轉的文本按類別注入側邊欄或通過模板標籤注入頁面正文。...。
Random Content 》此外掛允許您使用縮略語或小工具在您的網站任何位置顯示隨機內容。您可以將您的隨機內容分組,讓您在網站中的多個位置顯示不同的內容。, 透過自訂的文章類型...。
Classic Text Widget 》此外掛可讓您使用經典 WordPress 文字小工具,而不需要使用 TinyMCE 編輯器。其程式碼基於 WordPress Ver. 4.7.5。, 功能與版本 4.8 之前的預設文本小工具完...。
Special Text Boxes 》此外掛會新增一個小的樣式表檔案和短代碼到部落格中,以顏色方塊來突顯文章中的某些部分。提供了7種樣式,如警告、警示、資訊和下載等。 , 如果您需要探索此...。
Gettext override translations 》此外掛可讓您在管理面板中覆蓋預設文字。, 原本是為覆蓋 Woocommerce 的文字而建立,但也可作用於 WordPress Core 及其他外掛所添加的文字。, , 它將會翻譯所...。
Generate Dummy Posts 》使用 Generate Dummy Posts 外掛程式,您可以輕鬆地在一個按鈕點擊中創建虛擬文章。開發人員和設計師通常使用虛擬文本來創建或開發部落格式 WordPress 網站,...。
CopyRightPro 》CopyRightPro是一個外掛,可以防止從您的部落格複製文字和圖像,如果您安裝這個外掛,您的WordPress內容將會受到保護。, CopyRightPro是由Wp-CopyRightPro.Co...。